summaryrefslogtreecommitdiff
path: root/build-test.cmd
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-12-27 07:46:08 (GMT)
committerJiyoung Yun <jy910.yun@samsung.com>2016-12-27 07:46:08 (GMT)
commitdb20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch)
treee5435159cd1bf0519276363a6fe1663d1721bed3 /build-test.cmd
parent4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff)
downloadcoreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'build-test.cmd')
-rw-r--r--build-test.cmd82
1 files changed, 73 insertions, 9 deletions
diff --git a/build-test.cmd b/build-test.cmd
index d22b489..215fb53 100644
--- a/build-test.cmd
+++ b/build-test.cmd
@@ -1,4 +1,4 @@
-@if not defined __echo @echo off
+@if not defined _echo @echo off
setlocal EnableDelayedExpansion
:: Set the default arguments for build
@@ -28,6 +28,9 @@ set "__args= %*"
set processedArgs=
set __unprocessedBuildArgs=
set __RunArgs=
+set __BuildAgainstPackages=
+set __BuildAgainstPackagesArg=
+set __RuntimeId=
:Arg_Loop
if "%1" == "" goto ArgsDone
@@ -48,6 +51,8 @@ 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" == "runtimeid" (set __RuntimeId=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if [!processedArgs!]==[] (
call set __UnprocessedBuildArgs=!__args!
@@ -93,7 +98,7 @@ if not exist "%__LogsDir%" md "%__LogsDir%"
echo %__MsgPrefix%Checking prerequisites
:: Eval the output from probe-win1.ps1
-for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy RemoteSigned "& ""%__SourceDir%\pal\tools\probe-win.ps1"""') do %%a
+for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\pal\tools\probe-win.ps1"""') do %%a
REM =========================================================================================
REM ===
@@ -129,7 +134,7 @@ if defined __ToolsetDir (
:: Set the environment for the native build
echo %__MsgPrefix%Using environment: "%__VSToolsRoot%\..\..\VC\vcvarsall.bat" %__VCBuildArch%
call "%__VSToolsRoot%\..\..\VC\vcvarsall.bat" %__VCBuildArch%
-@if defined __echo @echo on
+@if defined _echo @echo on
if not defined VSINSTALLDIR (
echo %__MsgPrefix%Error: VSINSTALLDIR variable not defined.
@@ -141,7 +146,7 @@ if not exist "%VSINSTALLDIR%DIA SDK" goto NoDIA
pushd "%__NativeTestIntermediatesDir%"
call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" ""%__ProjectFilesDir%"" %__VSVersion% %__BuildArch%
-@if defined __echo @echo on
+@if defined _echo @echo on
popd
if not exist "%__NativeTestIntermediatesDir%\install.vcxproj" (
@@ -176,21 +181,56 @@ if errorlevel 1 (
:skipnative
-if defined __SkipManaged exit /b 0
+set __BuildLogRootName=Restore_Product
+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%"
+if not defined __BuildAgainstPackages goto SkipRestoreProduct
REM =========================================================================================
REM ===
-REM === Managed test build section
+REM === Restore product binaries from packages
REM ===
REM =========================================================================================
-echo %__MsgPrefix%Starting the Managed Tests Build
+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"
-if not defined VSINSTALLDIR (
- echo %__MsgPrefix%Error: buildtest.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.
+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%
+if errorlevel 1 (
+ echo BinPlace of mscorlib.dll failed
exit /b 1
)
+if defined __RuntimeId (
+
+ if not exist %__PackagesDir%\TestNativeBins (
+ echo %__MsgPrefix%Error: Ensure you have run sync.cmd -ab before building a non-Windows test overlay against packages
+ 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%
+
+ echo %__MsgPrefix% Created the runtime layout for %__RuntimeId% in %CORE_OVERLAY%
+)
+
+echo %__MsgPrefix% Created the runtime layout with all dependencies in %CORE_ROOT%
+
+:SkipRestoreProduct
+
+if defined __SkipManaged exit /b 0
+
set __BuildLogRootName=Tests_Managed
set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
@@ -199,6 +239,19 @@ set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
+REM =========================================================================================
+REM ===
+REM === Managed test build section
+REM ===
+REM =========================================================================================
+
+echo %__MsgPrefix%Starting the Managed Tests Build
+
+if not defined VSINSTALLDIR (
+ echo %__MsgPrefix%Error: buildtest.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
+)
+
if defined __UpdateInvalidPackagesArg (
set __up=-updateinvalidpackageversions
)
@@ -253,6 +306,17 @@ echo. -? -h -help: view this message.
echo Build architecture: -buildArch: only x64 is currently allowed ^(default: x64^).
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 debian.8-x64: Builds overlay for Debian 8
+echo fedora.23-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
+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 -- ... : 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)