summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/buildtest.cmd4
-rw-r--r--tests/runtest.cmd8
-rw-r--r--tests/runtest.proj78
3 files changed, 43 insertions, 47 deletions
diff --git a/tests/buildtest.cmd b/tests/buildtest.cmd
index 25fead4453..a73a67fbff 100644
--- a/tests/buildtest.cmd
+++ b/tests/buildtest.cmd
@@ -104,7 +104,7 @@ set UseRoslynCompiler=true
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions. && exit /b 1
-::Building Native part of Tests
+::Building Native part of Tests
setlocal
echo Commencing build of native test components for %__BuildArch%/%__BuildType%
@@ -171,7 +171,7 @@ exit /b %ERRORLEVEL%
:build
%_buildprefix% %_msbuildexe% "%__ProjectFilesDir%\build.proj" %__MSBCleanBuildArgs% /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=normal;LogFile="%__TestManagedBuildLog%";Append %* %_buildpostfix%
-IF ERRORLEVEL 1 echo Test build failed. Refer !__TestManagedBuildLog! for details && exit /b 1
+IF ERRORLEVEL 1 echo Test build failed. Refer to !__TestManagedBuildLog! for details && exit /b 1
exit /b 0
:Usage
diff --git a/tests/runtest.cmd b/tests/runtest.cmd
index 6c225fbb20..1c324333c8 100644
--- a/tests/runtest.cmd
+++ b/tests/runtest.cmd
@@ -38,7 +38,7 @@ if /i "%__VSVersion%" == "vs2015" set __VSProductVersion=140
:: Check presence of VS
if defined VS%__VSProductVersion%COMNTOOLS goto CheckMSbuild
-echo InVisual Studio 2013+ (Community is free) is a pre-requisite to build this repository.
+echo Visual Studio 2013+ (Community is free) is a pre-requisite to build this repository.
exit /b 1
:CheckMSBuild
@@ -54,7 +54,7 @@ set UseRoslynCompiler=true
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions. && exit /b 1
-:: Set the environment for the build- Vs cmd prompt
+:: Set the environment for the build- VS cmd prompt
call "!VS%__VSProductVersion%COMNTOOLS!\VsDevCmd.bat"
if not defined VSINSTALLDIR echo Error: runtest.cmd should be run from a Visual Studio Command Prompt. Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions. && exit /b 1
@@ -67,7 +67,7 @@ if not defined __BinDir set __BinDir=%__ProjectFilesDir%..\bin\Product\%__Bu
if not defined __TestWorkingDir set __TestWorkingDir=%__ProjectFilesDir%..\bin\tests\%__BuildOS%.%__BuildArch%.%__BuildType%
if not defined __LogsDir set __LogsDir=%__ProjectFilesDir%..\bin\Logs
-:: Default global test environmet variables
+:: Default global test environment variables
if not defined XunitTestBinBase set XunitTestBinBase=%__TestWorkingDir%\
if not defined XunitTestReportDirBase set XunitTestReportDirBase=%XunitTestBinBase%\Reports\
if defined Core_Root goto :CheckTestEnv
@@ -155,7 +155,7 @@ echo BuildArch is x64, x86
echo BuildType can be: Debug, Release
echo SkipWrapperGeneration- Optional parameter - this will run the same set of tests as the last time it was run
echo Exclude- Optional parameter - this will exclude individual tests from running, specified by ExcludeList ItemGroup in an .targets file.
-echo TestEnv- Optional parameter - this will run a custom script to set custom test envirommnent settings.
+echo TestEnv- Optional parameter - this will run a custom script to set custom test environment settings.
echo VSVersion- optional argument to use VS2013 or VS2015 (default VS2015)
echo CORE_ROOT The path to the runtime
exit /b 1
diff --git a/tests/runtest.proj b/tests/runtest.proj
index 71549d1703..97ab648f73 100644
--- a/tests/runtest.proj
+++ b/tests/runtest.proj
@@ -13,45 +13,38 @@
<DisabledTestDir Include="Common" />
<_SkipTestDir Include="@(DisabledTestDir)" />
</ItemGroup>
-
- <Target Name="FindCmdDirectories"
- DependsOnTargets="GetListOfTestCmds"
- >
+ <Target Name="FindCmdDirectories" DependsOnTargets="GetListOfTestCmds">
<Error Condition="!Exists('$(XunitTestBinBase)')"
- Text="$(XunitTestBinBase) does not exists. Please run buildtest.cmd from the (repo root)\tests at least once to get the tests built." />
- <ItemGroup>
-
- <AllTestDirsNonCanonicalPaths Include="$([System.IO.Directory]::GetDirectories(`$(XunitTestBinBase)`))" />
+ Text="$(XunitTestBinBase) does not exist. Please run buildtest.cmd from the (repo root)\tests at least once to get the tests built." />
+
+ <ItemGroup>
+ <AllTestDirsNonCanonicalPaths Include="$([System.IO.Directory]::GetDirectories(`$(XunitTestBinBase)`))" />
<AllTestDirsPaths Include="@(AllTestDirsNonCanonicalPaths)" />
<AllTestDirsPaths Include="@(AllTestDirsNonCanonicalPaths)" >
<Path>$([System.IO.Path]::GetFullPath(%(Identity)))</Path>
</AllTestDirsPaths>
-
<NonExcludedTestDirectories Include="@(AllTestDirsPaths -> '%(Path)')" Exclude="@(_SkipTestDir -> '$(XunitTestBinBase)%(Identity)')">
<Path>$([System.IO.Path]::GetFullPath(%(AllRunnableTestPaths.Identity)))</Path>
</NonExcludedTestDirectories>
-
<TestDirectoriesWithDup Include="@(NonExcludedTestDirectories -> '%(Identity)')" Condition="$([System.String]::new('%(Path)').StartsWith('%(Identity)'))" />
</ItemGroup>
- <RemoveDuplicates
- Inputs="@(TestDirectoriesWithDup)">
- <Output
- TaskParameter="Filtered"
- ItemName="TestDirectories"/>
- </RemoveDuplicates>
+ <RemoveDuplicates Inputs="@(TestDirectoriesWithDup)">
+ <Output
+ TaskParameter="Filtered"
+ ItemName="TestDirectories"/>
+ </RemoveDuplicates>
+
</Target>
-
<Import Project="$(__Exclude)" Condition="'$(__Exclude)' != '' AND '$(XunitTestBinBase)' != ''" />
- <Target Name="CreateXunitWrapper"
- DependsOnTargets="CreateXunitFacts">
+ <Target Name="CreateXunitWrapper" DependsOnTargets="CreateXunitFacts">
<PropertyGroup>
<_XunitWrapperGen >
@@ -143,11 +136,13 @@ $(_XunitEpilog)
<!-- <Exec Command="md" -->
<MakeDir Directories="$(XunitWrapperGeneratedCSDirBase)$(Category)"/>
+
<!-- Write the file -->
<WriteLinesToFile
File="$(XunitWrapperSrcDir)\$(XunitWrapper).cs"
Lines="$(_XunitWrapperGen)"
Overwrite="true" />
+
<!-- Write the file -->
<WriteLinesToFile
File="$(XunitWrapperSrcDir)\$(XunitWrapper).csproj"
@@ -160,11 +155,13 @@ $(_XunitEpilog)
Lines="$(XunitWrapperGenPackConfig)"
Overwrite="true" />
- <MSBuild Projects="$(XunitWrapperSrcDir)\$(XunitWrapper).csproj" />
+ <MSBuild Projects="$(XunitWrapperSrcDir)\$(XunitWrapper).csproj" />
+
</Target>
+
<Target Name="CreateXunitFacts">
<!-- NOTE! semicolons must be escaped with %3B boooo -->
-
+
<PropertyGroup>
<_CMDDIR_Parent>$([System.IO.Path]::GetDirectoryName($(_CMDDIR)))</_CMDDIR_Parent>
<Category>$([System.String]::Copy('$(_CMDDIR)').Replace($(_CMDDIR_Parent)\,''))</Category>
@@ -186,23 +183,24 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
]]>
</_XunitProlog>
- <_XunitEpilog Condition=" '$(_XunitEpilog)'=='' ">
+
+ <_XunitEpilog Condition=" '$(_XunitEpilog)'=='' ">
<![CDATA[
}
]]>
- </_XunitEpilog>
+ </_XunitEpilog>
</PropertyGroup>
<ItemGroup>
- <CanonicalExcludeList Include="%(ExcludeList.FullPath)" Condition="'$(__Exclude)' != ''"/>
+ <CanonicalExcludeList Include="%(ExcludeList.FullPath)" Condition="'$(__Exclude)' != ''"/>
</ItemGroup>
<ItemGroup>
- <AllCMDsPresent Include="$(_CMDDIR)\**\*.cmd" />
- <AllCMDExcludeFilter Include="@(CanonicalExcludeList)" Condition="'$(__Exclude)' != ''"/>
- <AllCMDs Include="@(AllCMDsPresent)" Exclude="@(AllCMDExcludeFilter)"/>
-
+ <AllCMDsPresent Include="$(_CMDDIR)\**\*.cmd" />
+ <AllCMDExcludeFilter Include="@(CanonicalExcludeList)" Condition="'$(__Exclude)' != ''"/>
+ <AllCMDs Include="@(AllCMDsPresent)" Exclude="@(AllCMDExcludeFilter)"/>
+
<AllCommamds Include="@(AllCMDs)" >
<_FactName>$([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)",'').Replace(".","_"))</_FactName>
@@ -285,7 +283,7 @@ public class $([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)"
}
}
-
+
]]>
</_XunitFact>
@@ -295,9 +293,7 @@ public class $([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)"
</Target>
- <Target Name="CreateAllWrappers"
- DependsOnTargets="GetListOfTestCmds;FindCmdDirectories">
-
+ <Target Name="CreateAllWrappers" DependsOnTargets="GetListOfTestCmds;FindCmdDirectories">
<MSBuild Projects="$(MSBuildProjectFile)" Targets="CreateXunitWrapper" Properties="_CMDDIR=%(TestDirectories.Identity)" />
</Target>
@@ -306,26 +302,26 @@ public class $([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)"
<AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.cmd" />
</ItemGroup>
</Target>
-
+
<Import Project="tests.targets" />
<Import Project="publishdependency.targets" />
-
+
<Target Name="Build">
<!-- Default for building -->
<MSBuild Projects="$(MSBuildProjectFile)"
- Targets="CreateAllWrappers"
- Properties="_CMDDIR=%(TestDirectories.Identity)"
- Condition=" '$(NoBuild)'!='true' " />
-
+ Targets="CreateAllWrappers"
+ Properties="_CMDDIR=%(TestDirectories.Identity)"
+ Condition=" '$(NoBuild)'!='true' " />
+
<!-- Execution -->
-
+
<MSBuild Projects="$(MSBuildProjectFile)" Targets="CopyDependecyToCoreRoot"
Condition=" '$(NoRun)'!='true' "/>
-
+
<MSBuild Projects="$(MSBuildProjectFile)" Targets="RunTests"
Condition=" '$(NoRun)'!='true' "/>
</Target>
-
+
<Target Name="Clean">
<RemoveDir Condition=" '$(NoBuild)'!='true'" Directories="$(XunitWrapperGeneratedCSDirBase);$(XunitWrapperOutputIntermediatedDirBase)" ContinueOnError="WarnAndContinue" />
</Target>