Skip to content

Commit

Permalink
Test: update test_coreclr.csproj so that tests are built and run one …
Browse files Browse the repository at this point in the history
…by one
  • Loading branch information
leasunhy committed May 2, 2017
1 parent 7887fee commit 38e9f5d
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions tests/test_coreclr.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
<Move SourceFiles="$([System.String]::Copy('%(Bak.Identity)'))" DestinationFiles="$([System.String]::Copy('%(Bak.Identity)').Replace('.csproj.bak', '.csproj'))" />
</Target>

<Target Name="Build">
<Target Name="Build" DependsOnTargets="ExeTest;NUnitTest" />


<!--Exe tests-->

<Target Name="ExeTest" Outputs="%(Exe.Identity)">
<Exec
Command="dotnet restore $([System.IO.Path]::GetFileName(%(Exe.Identity)))"
WorkingDirectory="$([System.IO.Path]::GetDirectoryName(%(Exe.Identity)))"
Expand All @@ -32,9 +30,27 @@
Command="dotnet run -p $([System.IO.Path]::GetFileName(%(Exe.Identity)))"
WorkingDirectory="$([System.IO.Path]::GetDirectoryName(%(Exe.Identity)))"
ContinueOnError="false" />
</Target>

<Target Name="NUnitTest" Outputs="%(Test.Identity)" DependsOnTargets="NUnitTestInit">
<MakeDir Directories="$(TestResultDir)/$([System.IO.Path]::GetFileNameWithoutExtension(%(Test.Identity)))"
ContinueOnError="true" />

<!--nUnit tests-->
<Exec
Command="dotnet restore $([System.IO.Path]::GetFileName(%(Test.Identity)))"
WorkingDirectory="$([System.IO.Path]::GetDirectoryName(%(Test.Identity)))"
ContinueOnError="false"/>
<Exec
Command="dotnet build -c Release $([System.IO.Path]::GetFileName(%(Test.Identity)))"
WorkingDirectory="$([System.IO.Path]::GetDirectoryName(%(Test.Identity)))"
ContinueOnError="true" />
<Exec
Command="dotnet $(MetaRunner) $(TestRunner) $(TestResultDir)/$([System.IO.Path]::GetFileNameWithoutExtension(%(Test.Identity))) bin/Release/netcoreapp2.0/$([System.IO.Path]::GetFileNameWithoutExtension(%(Test.Identity))).dll --workers=1 --timeout=1800000"
WorkingDirectory="$([System.IO.Path]::GetDirectoryName(%(Test.Identity)))"
ContinueOnError="true" Condition="Exists('$([System.IO.Path]::GetDirectoryName(%(Test.Identity)))/bin/Release/netcoreapp2.0/$([System.IO.Path]::GetFileNameWithoutExtension(%(Test.Identity))).dll')"/>
</Target>

<Target Name="NUnitTestInit">
<Exec
Command="dotnet restore"
WorkingDirectory="nunit_tools/nunit_test_runner"
Expand All @@ -55,20 +71,6 @@

<RemoveDir Directories="$(TestResultDir)" ContinueOnError="true" />
<MakeDir Directories="$(TestResultDir)" ContinueOnError="true" />
<MakeDir Directories="$(TestResultDir)/$([System.IO.Path]::GetFileNameWithoutExtension(%(Test.Identity)))"
ContinueOnError="true" />

<Exec
Command="dotnet restore $([System.IO.Path]::GetFileName(%(Test.Identity)))"
WorkingDirectory="$([System.IO.Path]::GetDirectoryName(%(Test.Identity)))"
ContinueOnError="false"/>
<Exec
Command="dotnet build -c Release $([System.IO.Path]::GetFileName(%(Test.Identity)))"
WorkingDirectory="$([System.IO.Path]::GetDirectoryName(%(Test.Identity)))"
ContinueOnError="true" />
<Exec
Command="dotnet $(MetaRunner) $(TestRunner) $(TestResultDir)/$([System.IO.Path]::GetFileNameWithoutExtension(%(Test.Identity))) bin/Release/netcoreapp2.0/$([System.IO.Path]::GetFileNameWithoutExtension(%(Test.Identity))).dll --workers=1 --timeout=1800000"
WorkingDirectory="$([System.IO.Path]::GetDirectoryName(%(Test.Identity)))"
ContinueOnError="true" Condition="Exists('$([System.IO.Path]::GetDirectoryName(%(Test.Identity)))/bin/Release/netcoreapp2.0/$([System.IO.Path]::GetFileNameWithoutExtension(%(Test.Identity))).dll')"/>
</Target>

</Project>

0 comments on commit 38e9f5d

Please sign in to comment.