summaryrefslogtreecommitdiff
path: root/build-test.cmd
diff options
context:
space:
mode:
Diffstat (limited to 'build-test.cmd')
-rw-r--r--build-test.cmd88
1 files changed, 75 insertions, 13 deletions
diff --git a/build-test.cmd b/build-test.cmd
index 215fb53..85753ab 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=
@@ -51,8 +54,9 @@ if /i "%1" == "checked" (set __BuildType=Checked&set processedArgs
if /i "%1" == "skipmanaged" (set __SkipManaged=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "updateinvalidpackages" (set __UpdateInvalidPackagesArg=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
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" == "buildagainstpackages" (set __BuildAgainstPackages=1&set __BuildAgainstPackagesArg=-BuildTestsAgainstPackages&set processedArgs=!processedArgs! %1&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!
@@ -105,14 +109,14 @@ REM ===
REM === Restore Build Tools
REM ===
REM =========================================================================================
-call %__ProjectDir%\init-tools.cmd
+call "%__ProjectDir%\init-tools.cmd"
REM =========================================================================================
REM ===
REM === Resolve runtime dependences
REM ===
REM =========================================================================================
-call %__TestDir%\setup-runtime-dependencies.cmd /arch %__BuildArch% /outputdir %__BinDir%
+call "%__TestDir%\setup-runtime-dependencies.cmd" /arch %__BuildArch% /outputdir %__BinDir%
if defined __UpdateInvalidPackagesArg (
goto skipnative
@@ -170,7 +174,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="%__NativeTestIntermediatesDir%\install.vcxproj" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__msbuildNativeArgs% %__RunArgs% %__unprocessedBuildArgs%
+call "%__ProjectDir%\run.cmd" build -Project="%__NativeTestIntermediatesDir%\install.vcxproj" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__msbuildNativeArgs% %__RunArgs% %__unprocessedBuildArgs%
if errorlevel 1 (
echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
echo %__BuildLog%
@@ -189,6 +193,8 @@ set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
+set "__TestWorkingDir=%__RootBinDir%\tests\%__BuildOS%.%__BuildArch%.%__BuildType%"
+
if not defined __BuildAgainstPackages goto SkipRestoreProduct
REM =========================================================================================
REM ===
@@ -196,16 +202,15 @@ REM === Restore product binaries from packages
REM ===
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%
+call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -UpdateDependencies -BatchRestorePackages -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
set __BuildLogRootName=Tests_GenerateRuntimeLayout
-call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -BinPlaceRef -BinPlaceProduct -CopyCrossgenToProduct -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
+call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -BinPlaceRef -BinPlaceProduct -CopyCrossgenToProduct -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
if errorlevel 1 (
echo BinPlace of mscorlib.dll failed
exit /b 1
@@ -218,14 +223,14 @@ if defined __RuntimeId (
exit /b 1
)
- call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -CreateNonWindowsTestOverlay -RuntimeId="%__RuntimeId%" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
- for /R %__PackagesDir%\TestNativeBins\%__RuntimeId% %%f in (*.so) do copy %%f %Core_Overlay%
- for /R %__PackagesDir%\TestNativeBins\%__RuntimeId% %%f in (*.dylib) do copy %%f %Core_Overlay%
+ call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -CreateNonWindowsTestOverlay -RuntimeId="%__RuntimeId%" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
+ for /R %__PackagesDir%\TestNativeBins\%__RuntimeId%\%__BuildType% %%f in (*.so) do copy %%f %Core_Overlay%
+ for /R %__PackagesDir%\TestNativeBins\%__RuntimeId%\%__BuildType% %%f in (*.dylib) do copy %%f %Core_Overlay%
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
@@ -256,7 +261,7 @@ if defined __UpdateInvalidPackagesArg (
set __up=-updateinvalidpackageversions
)
-call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\build.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__up% %__RunArgs% %__unprocessedBuildArgs%
+call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__up% %__RunArgs% %__unprocessedBuildArgs%
if errorlevel 1 (
echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
echo %__BuildLog%
@@ -265,7 +270,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...
@@ -286,6 +322,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 +366,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 +377,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)