summaryrefslogtreecommitdiff
path: root/build-test.cmd
diff options
context:
space:
mode:
authorwtgodbe <wigodbe@microsoft.com>2017-01-17 22:47:51 (GMT)
committerwtgodbe <wigodbe@microsoft.com>2017-01-24 20:35:50 (GMT)
commiteb610f615bc4076ad950c98157e83bc34649064f (patch)
tree111869be6a4bba0ff85583c7fe2997fd9ddc37f2 /build-test.cmd
parent6a3c584b80dde7752a595344b3dc727918c94183 (diff)
downloadcoreclr-eb610f615bc4076ad950c98157e83bc34649064f.zip
coreclr-eb610f615bc4076ad950c98157e83bc34649064f.tar.gz
coreclr-eb610f615bc4076ad950c98157e83bc34649064f.tar.bz2
Add support for running CoreCLR Tests in Helix
Diffstat (limited to 'build-test.cmd')
-rw-r--r--build-test.cmd67
1 files changed, 64 insertions, 3 deletions
diff --git a/build-test.cmd b/build-test.cmd
index a2ff717..8f19d7b 100644
--- a/build-test.cmd
+++ b/build-test.cmd
@@ -23,6 +23,9 @@ set "__PackagesDir=%__ProjectDir%\packages"
set "__RootBinDir=%__ProjectDir%\bin"
set "__LogsDir=%__RootBinDir%\Logs"
+:: Default __Exclude to issues.targets
+set __Exclude=%__TestDir%\issues.targets
+
REM __unprocessedBuildArgs are args that we pass to msbuild (e.g. /p:__BuildArch=x64)
set "__args= %*"
set processedArgs=
@@ -53,6 +56,7 @@ if /i "%1" == "updateinvalidpackages" (set __UpdateInvalidPackagesArg=1&set proc
if /i "%1" == "toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if /i "%1" == "buildagainstpackages" (set __BuildAgainstPackages=1&set __BuildAgainstPackagesArg=-BuildTestsAgainstPackages&shift&goto Arg_Loop)
if /i "%1" == "runtimeid" (set __RuntimeId=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
+if /i "%1" == "Exclude" (set __Exclude=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if [!processedArgs!]==[] (
call set __UnprocessedBuildArgs=!__args!
@@ -199,7 +203,7 @@ REM ============================================================================
set "__TestWorkingDir=%__RootBinDir%\tests\%__BuildOS%.%__BuildArch%.%__BuildType%"
if not defined XunitTestBinBase set XunitTestBinBase=%__TestWorkingDir%
set "CORE_ROOT=%XunitTestBinBase%\Tests\Core_Root"
-set "CORE_OVERLAY=%XunitTestBinBase%\Tests\coreoverlay"
+set "CORE_OVERLAY=%XunitTestBinBase%\Tests\Core_Root_%__RuntimeId%"
call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -UpdateDependencies -BatchRestorePackages -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
@@ -225,7 +229,7 @@ if defined __RuntimeId (
echo %__MsgPrefix% Created the runtime layout for %__RuntimeId% in %CORE_OVERLAY%
)
-echo %__MsgPrefix% Created the runtime layout with all dependencies in %CORE_ROOT%
+echo %__MsgPrefix% Restored CoreCLR product from packages
:SkipRestoreProduct
@@ -265,7 +269,38 @@ if errorlevel 1 (
exit /b 1
)
+REM Prepare the Test Drop
+REM Cleans any NI from the last run
+powershell "Get-ChildItem -path %__TestWorkingDir% -Include '*.ni.*' -Recurse -Force | Remove-Item -force"
+REM Cleans up any lock folder used for synchronization from last run
+powershell "Get-ChildItem -path %__TestWorkingDir% -Include 'lock' -Recurse -Force | where {$_.Attributes -eq 'Directory'}| Remove-Item -force -Recurse"
+
set CORE_ROOT=%__TestBinDir%\Tests\Core_Root
+if exist "%CORE_ROOT%" rd /s /q "%CORE_ROOT%"
+md "%CORE_ROOT%"
+xcopy /s "%__BinDir%" "%CORE_ROOT%"
+
+echo %__MsgPrefix%Creating test wrappers...
+
+set RuntimeIdArg=
+
+if defined __RuntimeId (
+ set RuntimeIdArg=-RuntimeID="%__RuntimeId%"
+)
+
+set __BuildLogRootName=Tests_XunitWrapper
+set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
+set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
+set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
+set __msbuildLog=/flp:Verbosity=diag;LogFile="%__BuildLog%"
+set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
+set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
+
+call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -BuildWrappers -MsBuildEventLogging=" " -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% %RuntimeIdArg%
+if errorlevel 1 (
+ echo Xunit Wrapper build failed
+ exit /b 1
+)
echo %__MsgPrefix%Creating test overlay...
@@ -277,7 +312,7 @@ set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
-call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -testOverlay -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__unprocessedBuildArgs%
+call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -testOverlay -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__unprocessedBuildArgs%
if errorlevel 1 (
echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
echo %__BuildLog%
@@ -286,6 +321,28 @@ if errorlevel 1 (
exit /b 1
)
+if not defined __BuildAgainstPackages goto SkipPrepForPublish
+
+set __BuildLogRootName=Helix_Prep
+set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
+set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
+set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
+set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
+set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
+set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
+
+REM =========================================================================================
+REM ===
+REM === Prep test binaries for Helix publishing
+REM ===
+REM =========================================================================================
+
+call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\helixprep.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% %RuntimeIdArg%
+
+echo %__MsgPrefix% Prepped test binaries for publishing
+
+:SkipPrepForPublish
+
REM =========================================================================================
REM ===
REM === All builds complete!
@@ -308,8 +365,10 @@ echo Build type: -buildType: one of Debug, Checked, Release ^(default: Debug^).
echo updateinvalidpackageversions: Runs the target to update package versions.
echo buildagainstpackages: builds tests against restored packages, instead of against a built product.
echo runtimeid ^<ID^>: Builds a test overlay for the specified OS (Only supported when building against packages). Supported IDs are:
+echo alpine.3.4.3-x64: Builds overlay for Alpine 3.4.3
echo debian.8-x64: Builds overlay for Debian 8
echo fedora.23-x64: Builds overlay for Fedora 23
+echo fedora.24-x64: Builds overlay for Fedora 23
echo opensuse.13.2-x64: Builds overlay for OpenSUSE 13.2
echo opensuse.42.1-x64: Builds overlay for OpenSUSE 42.1
echo osx.10.10-x64: Builds overlay for OSX 10.10
@@ -317,6 +376,8 @@ echo rhel.7-x64: Builds overlay for RHEL 7 or CentOS
echo ubuntu.14.04-x64: Builds overlay for Ubuntu 14.04
echo ubuntu.16.04-x64: Builds overlay for Ubuntu 16.04
echo ubuntu.16.10-x64: Builds overlay for Ubuntu 16.10
+echo Exclude- Optional parameter - specify location of default exclusion file (defaults to tests\issues.targets if not specified)
+echo Set to "" to disable default exclusion file.
echo -- ... : all arguments following this tag will be passed directly to msbuild.
echo -priority=^<N^> : specify a set of test that will be built and run, with priority N.
echo 0: Build only priority 0 cases as essential testcases (default)