Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
c64149a3
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c64149a3
编写于
8月 06, 2015
作者:
J
Jared Parsons
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4279 from jasonmalinowski/open-source-build-improvements
Open source build improvements
上级
53ed0035
03087e03
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
57 deletion
+41
-57
BuildAndTest.proj
BuildAndTest.proj
+4
-33
build/Targets/VSL.Imports.targets
build/Targets/VSL.Imports.targets
+1
-1
build/Targets/VSL.Settings.targets
build/Targets/VSL.Settings.targets
+15
-8
cibuild.cmd
cibuild.cmd
+2
-2
src/Tools/Source/RunTests/ProcessRunner.cs
src/Tools/Source/RunTests/ProcessRunner.cs
+5
-5
src/Tools/Source/RunTests/TestRunner.cs
src/Tools/Source/RunTests/TestRunner.cs
+14
-8
未找到文件。
BuildAndTest.proj
浏览文件 @
c64149a3
...
...
@@ -12,12 +12,9 @@
<PropertyGroup>
<RoslynSolution>$(MSBuildThisFileDirectory)Roslyn.sln</RoslynSolution>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<RunTestArgs></RunTestArgs>
<RunTestArgs Condition="'$(Test64)' == 'true'">-test64</RunTestArgs>
<RunTestArgs>
$(RunTestArgs) -xml
</RunTestArgs>
<RunTestArgs Condition="'$(Test64)' == 'true'">
$(RunTestArgs)
-test64</RunTestArgs>
<IncludePattern Condition="'$(IncludePattern)' == ''">*.UnitTests*.dll</IncludePattern>
<!-- Emit XML in a CIBuild in order to get structured test results -->
<RunTestArgs Condition="'$(CIBuild)' == 'true'">$(RunTestArgs) -xml</RunTestArgs>
</PropertyGroup>
<Target Name="RestorePackages">
...
...
@@ -47,34 +44,8 @@
</Target>
<Target Name="Test">
<ItemGroup Condition="'$(PublicBuild)' == '' AND '$(CIBuild)' == ''">
<TestAssemblies
Include="Binaries\$(Configuration)\**\$(IncludePattern)"
Exclude="Binaries\$(Configuration)\Roslyn.Compilers.NativeClient.UnitTests.dll" />
</ItemGroup>
<ItemGroup Condition="'$(PublicBuild)' == '' AND '$(CIBuild)' == 'true'">
<TestAssemblies
Include="Binaries\$(Configuration)\**\$(IncludePattern)"
Exclude="
Binaries\$(Configuration)\Roslyn.Compilers.NativeClient.UnitTests.dll;
Binaries\$(Configuration)\Microsoft.CodeAnalysis.Scripting.UnitTests.dll;" />
</ItemGroup>
<!-- The Microsoft.CodeAnalysis.Scripting.UnitTests.dll is disabled due to https://github.com/dotnet/roslyn/issues/860 -->
<ItemGroup Condition="'$(PublicBuild)' == 'true' AND '$(CIBuild)' == ''">
<TestAssemblies
Include="Binaries\$(Configuration)\**\$(IncludePattern)"
Exclude="
Binaries\$(Configuration)\Roslyn.Compilers.NativeClient.UnitTests.dll;
Binaries\$(Configuration)\Microsoft.CodeAnalysis.Scripting.UnitTests.dll;
Binaries\$(Configuration)\Roslyn.Services.Editor.UnitTests2.dll;
Binaries\$(Configuration)\Roslyn.Services.Editor.UnitTests.dll;
Binaries\$(Configuration)\Roslyn.ExpressionEvaluator.CSharp.ResultProvider.UnitTests.dll;
Binaries\$(Configuration)\Roslyn.ExpressionEvaluator.VisualBasic.ResultProvider.UnitTests.dll;
Binaries\$(Configuration)\Roslyn.Services.Editor.VisualBasic.UnitTests.dll;
Binaries\$(Configuration)\Roslyn.Services.Editor.CSharp.UnitTests.dll;" />
<ItemGroup>
<TestAssemblies Include="Binaries\$(Configuration)\**\$(IncludePattern)" />
</ItemGroup>
<Exec Command="Binaries\$(Configuration)\RunTests.exe packages\xunit.runners.2.0.0-alpha-build2576\tools $(RunTestArgs) @(TestAssemblies, ' ')" />
...
...
build/Targets/VSL.Imports.targets
浏览文件 @
c64149a3
...
...
@@ -209,7 +209,7 @@
==================================================================================== -->
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != '' AND '$(ImportVSSDKTargets)' == 'true'
AND '$(CIBuild)' == ''
" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != '' AND '$(ImportVSSDKTargets)' == 'true'" />
<!-- ====================================================================================
...
...
build/Targets/VSL.Settings.targets
浏览文件 @
c64149a3
...
...
@@ -4,7 +4,17 @@
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props') AND '$(MSBuildProjectExtension)' != '.vcxproj'" />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(DevEnvDir)' == ''">
<DevEnvDir>$(VSINSTALLDIR)\Common7\IDE</DevEnvDir>
<DevEnvDir Condition="'$(VisualStudioVersion)' == '12.0'">$(VS120COMNTOOLS)\..\IDE</DevEnvDir>
<DevEnvDir Condition="'$(VisualStudioVersion)' == '14.0'">$(VS140COMNTOOLS)\..\IDE</DevEnvDir>
<DevEnvDir>$([System.IO.Path]::GetFullPath('$(DevEnvDir)'))</DevEnvDir>
</PropertyGroup>
<PropertyGroup>
<VisualStudioReferenceMajorVersion Condition="'$(VisualStudioReferenceMajorVersion)' == ''">$(VisualStudioVersion.Substring(0, $(VisualStudioVersion.IndexOf('.'))))</VisualStudioReferenceMajorVersion>
<VisualStudioReferenceAssemblyVersion Condition="'$(VisualStudioReferenceAssemblyVersion)' == ''">$(VisualStudioReferenceMajorVersion).0.0.0</VisualStudioReferenceAssemblyVersion>
<VisualStudioCodename>Dev$(VisualStudioReferenceMajorVersion)</VisualStudioCodename>
...
...
@@ -33,6 +43,10 @@
<MicrosoftDiaSymReaderNativeVersion>1.1.0-alpha1</MicrosoftDiaSymReaderNativeVersion>
<NuGetCommandLineVersion>$(NuGetCommandLineAssemblyVersion)</NuGetCommandLineVersion>
<MicrosoftCompositionVersion>$(MicrosoftCompositionAssemblyVersion)</MicrosoftCompositionVersion>
<!-- If we still have Roslyn installed, our VSIX-producing packages are not going to install, so let's not even try.
OpenSourceDebug overrides this by simple virtue that it's property setting is after the include of this file -->
<DeployExtension Condition="Exists('$(DevEnvDir)\CommonExtensions\Microsoft\Roslyn\Language Services\extension.vsixmanifest')">false</DeployExtension>
</PropertyGroup>
<Choose>
...
...
@@ -233,13 +247,6 @@
<FakeSignToolPath>$(MSBuildThisFileDirectory)..\..\packages\FakeSign.0.9.2\tools\FakeSign.exe</FakeSignToolPath>
</PropertyGroup>
<PropertyGroup Condition="'$(DevEnvDir)' == ''">
<DevEnvDir>$(VSINSTALLDIR)\Common7\IDE</DevEnvDir>
<DevEnvDir Condition="'$(VisualStudioVersion)' == '12.0'">$(VS120COMNTOOLS)\..\IDE</DevEnvDir>
<DevEnvDir Condition="'$(VisualStudioVersion)' == '14.0'">$(VS140COMNTOOLS)\..\IDE</DevEnvDir>
<DevEnvDir>$([System.IO.Path]::GetFullPath('$(DevEnvDir)'))</DevEnvDir>
</PropertyGroup>
<Choose>
<When Condition="'$(BuildVersion)' != ''">
<!-- The user specified a build version number. In that case, we'll use their version number
...
...
cibuild.cmd
浏览文件 @
c64149a3
...
...
@@ -24,14 +24,14 @@ move Binaries\%BuildConfiguration%\* %RoslynRoot%\Binaries\Bootstrap
msbuild
/v
:m
/t
:Clean
build
/Toolset
.sln
/p
:Configuration
=
%BuildConfiguration%
taskkill
/F /IM
vbcscompiler
.exe
msbuild
/v
:m
/m /p
:BootstrapBuildPath
=
%RoslynRoot%
\Binaries\Bootstrap
BuildAndTest
.proj
/p
:C
IBuild
=
true
/p
:C
onfiguration
=
%BuildConfiguration%
msbuild
/v
:m
/m /p
:BootstrapBuildPath
=
%RoslynRoot%
\Binaries\Bootstrap
BuildAndTest
.proj
/p
:Configuration
=
%BuildConfiguration%
if
ERRORLEVEL
1
(
taskkill
/F /IM
vbcscompiler
.exe
echo
Build
failed
exit
/b
1
)
msbuild
/v
:m
/m /p
:BootstrapBuildPath
=
%RoslynRoot%
\Binaries\Bootstrap
src
/Samples/Samples
.sln
/p
:C
IBuild
=
true
/p
:C
onfiguration
=
%BuildConfiguration%
msbuild
/v
:m
/m /p
:BootstrapBuildPath
=
%RoslynRoot%
\Binaries\Bootstrap
src
/Samples/Samples
.sln
/p
:Configuration
=
%BuildConfiguration%
if
ERRORLEVEL
1
(
taskkill
/F /IM
vbcscompiler
.exe
echo
Build
failed
...
...
src/Tools/Source/RunTests/ProcessRunner.cs
浏览文件 @
c64149a3
...
...
@@ -12,25 +12,25 @@ namespace RunTests
public
sealed
class
ProcessOutput
{
private
readonly
int
_exitCode
;
private
readonly
I
Enumerable
<
string
>
_outputLines
;
private
readonly
I
Enumerable
<
string
>
_errorLines
;
private
readonly
I
List
<
string
>
_outputLines
;
private
readonly
I
List
<
string
>
_errorLines
;
public
int
ExitCode
{
get
{
return
_exitCode
;
}
}
public
I
Enumerable
<
string
>
OutputLines
public
I
List
<
string
>
OutputLines
{
get
{
return
_outputLines
;
}
}
public
I
Enumerable
<
string
>
ErrorLines
public
I
List
<
string
>
ErrorLines
{
get
{
return
_errorLines
;
}
}
public
ProcessOutput
(
int
exitCode
,
I
Enumerable
<
string
>
outputLines
,
IEnumerable
<
string
>
errorLines
)
public
ProcessOutput
(
int
exitCode
,
I
List
<
string
>
outputLines
,
IList
<
string
>
errorLines
)
{
_exitCode
=
exitCode
;
_outputLines
=
outputLines
;
...
...
src/Tools/Source/RunTests/TestRunner.cs
浏览文件 @
c64149a3
...
...
@@ -118,7 +118,7 @@ private async Task<TestResult> RunTest(string assemblyPath, CancellationToken ca
builder
.
AppendFormat
(
@" -{0} ""{1}"""
,
_useHtml
?
"html"
:
"xml"
,
resultsPath
);
builder
.
Append
(
" -noshadow"
);
var
errorOutput
=
string
.
Empty
;
var
errorOutput
=
new
StringBuilder
()
;
var
start
=
DateTime
.
UtcNow
;
var
processOutput
=
await
ProcessRunner
.
RunProcessAsync
(
_xunitConsolePath
,
...
...
@@ -155,13 +155,19 @@ private async Task<TestResult> RunTest(string assemblyPath, CancellationToken ca
File
.
Delete
(
resultsPath
);
}
errorOutput
=
processOutput
.
ErrorLines
.
Any
()
?
processOutput
.
ErrorLines
.
Aggregate
((
x
,
y
)
=>
x
+
Environment
.
NewLine
+
y
)
:
string
.
Format
(
"xunit produced no error output but had exit code {0}"
,
processOutput
.
ExitCode
);
errorOutput
.
AppendLine
(
$"Command:
{
_xunitConsolePath
}
{
builder
}
"
);
errorOutput
=
string
.
Format
(
"Command: {0} {1}"
,
_xunitConsolePath
,
builder
.
ToString
())
+
Environment
.
NewLine
+
errorOutput
;
if
(
processOutput
.
ErrorLines
.
Any
())
{
foreach
(
var
line
in
processOutput
.
ErrorLines
)
{
errorOutput
.
AppendLine
(
line
);
}
}
else
{
errorOutput
.
AppendLine
(
$"xunit produced no error output but had exit code
{
processOutput
.
ExitCode
}
"
);
}
// If the results are html, use Process.Start to open in the browser.
...
...
@@ -171,7 +177,7 @@ private async Task<TestResult> RunTest(string assemblyPath, CancellationToken ca
}
}
return
new
TestResult
(
processOutput
.
ExitCode
==
0
,
assemblyName
,
span
,
errorOutput
);
return
new
TestResult
(
processOutput
.
ExitCode
==
0
,
assemblyName
,
span
,
errorOutput
.
ToString
()
);
}
private
static
void
DeleteFile
(
string
filePath
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录