Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] Run tests in parallel on non-Windows #2224

Merged
merged 1 commit into from
Oct 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 39 additions & 6 deletions build-tools/scripts/RunTests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,51 @@
<MSBuild Projects="$(MSBuildThisFileDirectory)..\timing\timing.csproj" Targets="MSBuildTiming" />
</Target>
<ItemGroup>
<_RunTestTarget Include="RunNUnitTests" />
<_RunTestTarget Include="RunJavaInteropTests" />
<_RunTestTarget Include="RunApkTests" />
<_RunParallelTestTarget Include="RunNUnitTests" />
<_RunParallelTestTarget Include="RunJavaInteropTests" />
<_RunParallelTestTarget Include="RunApkTests" />
</ItemGroup>
<ItemGroup>
<_RunTestTarget Include="RunPerformanceTests" />
</ItemGroup>
<Target Name="RunAllTests">
<MSBuild
Condition=" '$(HostOS)' == 'Windows' "
ContinueOnError="ErrorAndContinue"
Projects="$(MSBuildThisFileDirectory)RunTests.targets"
RunEachTargetSeparately="True"
Targets="@(_RunTestTarget)"
Targets="@(_RunParallelTestTarget)"
/>
</Target>
<ItemGroup Condition=" '$(USE_MSBUILD)' == '1' ">
<_RunParallelTestTarget>
<_BinLog>$(_XABinLogPrefix)-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss"))-Target-%(Identity).binlog"</_BinLog>
</_RunParallelTestTarget>
</ItemGroup>
<ItemGroup>
<_Commands Include="@(_RunParallelTestTarget->'echo Executing in background: msbuild $(MSBuildThisFileDirectory)RunTests.targets %(_BinLog) /t:%(Identity)')" />
<_Commands Include="@(_RunParallelTestTarget->'msbuild $(MSBuildThisFileDirectory)RunTests.targets %(_BinLog) /t:%(Identity) &amp;')" />
<_Commands Include="wait" />
<_Commands Include="exit 0" />
</ItemGroup>
<PropertyGroup>
<_ParallelTargets>$(MSBuildThisFileDirectory)..\..\bin\Test$(Configuration)\parallel-targets.sh</_ParallelTargets>
</PropertyGroup>
<WriteLinesToFile
File="$(_ParallelTargets)"
Lines="@(_Commands)"
Overwrite="True"
/>
<Exec
Condition=" '$(HostOS)' != 'Windows' "
ContinueOnError="ErrorAndContinue"
WorkingDirectory="$(_TopDir)"
Command="bash &quot;$(_ParallelTargets)&quot;"
/>
<MSBuild
ContinueOnError="ErrorAndContinue"
Projects="$(MSBuildThisFileDirectory)RunTests.targets"
RunEachTargetSeparately="True"
Targets="@(_RunTestTarget)"
/>
</Target>
</Project>