forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildAndTest.proj
133 lines (111 loc) · 7.72 KB
/
BuildAndTest.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="BuildAndTest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)build\Targets\Versions.props" />
<PropertyGroup>
<RoslynSolution Condition="'$(RoslynSolution)' == ''">$(MSBuildThisFileDirectory)Roslyn.sln</RoslynSolution>
<SamplesSolution>$(MSBuildThisFileDirectory)src\Samples\Samples.sln</SamplesSolution>
<TestVsi Condition="'$(testVsiNetCore)' == 'true'">true</TestVsi>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<RunTestArgs>$(RunTestArgs) -timeout:50</RunTestArgs>
<RunTestArgs Condition="'$(ManualTest)' == ''">$(RunTestArgs) -xml</RunTestArgs>
<RunTestArgs Condition="'$(Test64)' == 'true'">$(RunTestArgs) -test64</RunTestArgs>
<RunTestArgs Condition="'$(TestVsi)' == 'true'">$(RunTestArgs) -testVsi</RunTestArgs>
<RunTestArgs Condition="'$(TestVsiNetCore)' == 'true'">$(RunTestArgs) -trait:Feature=NetCore</RunTestArgs>
<RunTestArgs Condition="'$(Trait)' != ''">$(RunTestArgs) -trait:$(Trait)</RunTestArgs>
<RunTestArgs Condition="'$(NoTrait)' != ''">$(RunTestArgs) -notrait:$(NoTrait)</RunTestArgs>
<RunTestArgs Condition="'$(ProcDumpDir)' != ''">$(RunTestArgs) -procDumpPath:$(ProcDumpDir)</RunTestArgs>
<DeployExtensionViaBuild Condition="'$(DeployExtensionViaBuild)' == ''">false</DeployExtensionViaBuild>
<IncludePattern Condition="'$(IncludePattern)' == '' AND '$(TestVsi)' != 'true'">*.UnitTests.dll</IncludePattern>
<IncludePattern Condition="'$(IncludePattern)' == '' AND '$(TestVsi)' == 'true'">*.IntegrationTests.dll</IncludePattern>
<OutputDirectory>$(MSBuildThisFileDirectory)Binaries\$(Configuration)\</OutputDirectory>
<RunTestArgs>$(RunTestArgs) -log:"$(OutputDirectory)\runtests.log"</RunTestArgs>
<CoreClrTestDirectory>$(OutputDirectory)\CoreClrTest</CoreClrTestDirectory>
</PropertyGroup>
<Target Name="Build">
<MSBuild BuildInParallel="true"
Projects="$(RoslynSolution)"
Properties="DeployExtension=$(DeployExtensionViaBuild)"
Targets="Build" />
<MSBuild BuildInParallel="true"
Condition="'$(ManualTest)' == ''"
Projects="$(SamplesSolution)"
Properties="DeployExtension=false"
Targets="Build" />
</Target>
<Target Name="Clean">
<MSBuild BuildInParallel="true"
Projects="$(RoslynSolution)"
Targets="Clean" />
<MSBuild BuildInParallel="true"
Condition="'$(ManualTest)' == ''"
Projects="$(SamplesSolution)"
Targets="Clean" />
</Target>
<Target Name="Rebuild">
<MSBuild BuildInParallel="true"
Projects="$(RoslynSolution)"
Targets="Rebuild" />
<MSBuild BuildInParallel="true"
Condition="'$(ManualTest)' == ''"
Projects="$(SamplesSolution)"
Targets="Rebuild" />
</Target>
<Target
Name="Test"
DependsOnTargets="DeployRoslynVsix"
Condition="'$(TestDesktop)' == 'true' or '$(TestCoreClr)' == 'true' or '$(TestVsi)' == 'true'">
<ItemGroup>
<AssembliesToCopyLocal Include="$(NuGetPackageRoot)\xunit\$(xunitVersion)\*.dll;
$(NuGetPackageRoot)\xunit.assert\$(xunitassertVersion)\lib\portable-net45+netcore45+wp8+wpa81\*.dll" />
</ItemGroup>
<!-- Copy xunit stuff to output directory -->
<Copy SourceFiles="@(AssembliesToCopyLocal)"
DestinationFolder="$(OutputDirectory)"
SkipUnchangedFiles="true"
UseHardlinksIfPossible="true" />
<MakeDir Directories="$(CoreClrTestDirectory)\xUnitResults" />
<!-- Publish binaries for CoreClr test -->
<MSBuild BuildInParallel="true"
Condition="'$(TestCoreClr)' == 'true'"
Projects="src\Test\DeployCoreClrTestRuntime\DeployCoreClrTestRuntime.csproj"
Properties="RuntimeIdentifier=win7-x64;PublishDir=$(CoreClrTestDirectory)"
Targets="Publish" />
<ItemGroup>
<!-- MakeConst unit tests tracked by https://github.com/dotnet/roslyn/issues/5918 -->
<TestAssemblies Condition="'$(Test64)' != 'true'"
Include="$(OutputDirectory)UnitTests*\**\$(IncludePattern);" />
<TestAssemblies Condition="'$(Test64)' == 'true'"
Include="$(OutputDirectory)UnitTests*\**\$(IncludePattern);"
Exclude="$(OutputDirectory)UnitTests*\**\Roslyn.Interactive*" />
<CoreTestAssemblies Include="$(CoreClrTestDirectory)\$(IncludePattern)" />
</ItemGroup>
<PropertyGroup>
<CoreRunExe>$(CoreClrTestDirectory)\CoreRun.exe</CoreRunExe>
<CoreRunArgs>$(CoreClrTestDirectory)\xunit.console.netcore.exe @(CoreTestAssemblies, ' ') -parallel all -xml $(CoreClrTestDirectory)\xUnitResults\TestResults.xml</CoreRunArgs>
<RunTestsExe>Binaries\$(Configuration)\Exes\RunTests\RunTests.exe</RunTestsExe>
<RunTestsArgs>$(NuGetPackageRoot)\xunit.runner.console\$(xunitrunnerconsoleVersion)\tools $(RunTestArgs) @(TestAssemblies, ' ')</RunTestsArgs>
<VsixExpInstallerExe>$(NuGetPackageRoot)\roslyntools.microsoft.vsixexpinstaller\$(RoslynToolsMicrosoftVSIXExpInstallerVersion)\tools\VsixExpInstaller.exe</VsixExpInstallerExe>
<VsixExpInstallerArgs>-rootSuffix:RoslynDev -vsInstallDir:"$([System.IO.Path]::GetFullPath('$(MSBuildBinPath)\..\..\..'))"</VsixExpInstallerArgs>
</PropertyGroup>
<!-- Run CoreClr tests -->
<Exec Condition="'$(TestCoreClr)' == 'true'" Command=""$(CoreRunExe)" $(CoreRunArgs)" />
<!-- Run Desktop tests -->
<Exec Condition="'$(TestDesktop)' == 'true' or '$(TestVsi)' == 'true'" Command=""$(RunTestsExe)" $(RunTestsArgs)" />
</Target>
<!-- Manually deploy any VSIX required by our integration tests (https://github.com/dotnet/roslyn/issues/17456) -->
<Target Name="DeployRoslynVsix" Condition="'$(TestVsi)' == 'true' AND '$(DeployExtensionViaBuild)' != 'true'">
<PropertyGroup>
<VsixExpInstallerExe>$(NuGetPackageRoot)\roslyntools.microsoft.vsixexpinstaller\$(RoslynToolsMicrosoftVSIXExpInstallerVersion)\tools\VsixExpInstaller.exe</VsixExpInstallerExe>
<VsixExpInstallerArgs>-rootSuffix:RoslynDev -vsInstallDir:"$([System.IO.Path]::GetFullPath('$(MSBuildBinPath)\..\..\..'))"</VsixExpInstallerArgs>
</PropertyGroup>
<Exec Command=""$(VsixExpInstallerExe)" $(VsixExpInstallerArgs) $(OutputDirectory)\Vsix\CompilerExtension\Roslyn.Compilers.Extension.vsix" />
<Exec Command=""$(VsixExpInstallerExe)" $(VsixExpInstallerArgs) $(OutputDirectory)\Vsix\VisualStudioSetup\Roslyn.VisualStudio.Setup.vsix" />
<Exec Command=""$(VsixExpInstallerExe)" $(VsixExpInstallerArgs) $(OutputDirectory)\Vsix\VisualStudioSetup.Next\Roslyn.VisualStudio.Setup.Next.vsix" />
<Exec Command=""$(VsixExpInstallerExe)" $(VsixExpInstallerArgs) $(OutputDirectory)\Vsix\VisualStudioInteractiveComponents\Roslyn.VisualStudio.InteractiveComponents.vsix" />
<Exec Command=""$(VsixExpInstallerExe)" $(VsixExpInstallerArgs) $(OutputDirectory)\Vsix\ExpressionEvaluatorPackage\ExpressionEvaluatorPackage.vsix" />
<Exec Command=""$(VsixExpInstallerExe)" $(VsixExpInstallerArgs) $(OutputDirectory)\Vsix\VisualStudioDiagnosticsWindow\Roslyn.VisualStudio.DiagnosticsWindow.vsix" />
<Exec Command=""$(VsixExpInstallerExe)" $(VsixExpInstallerArgs) $(OutputDirectory)\Vsix\VisualStudioIntegrationTestSetup\Microsoft.VisualStudio.IntegrationTest.Setup.vsix" />
</Target>
<Target Name="BuildAndTest" DependsOnTargets="Build;Test" />
</Project>