From 3fa109c73de2b56059f8b7204503efab40d66d86 Mon Sep 17 00:00:00 2001 From: Sejong Oh Date: Wed, 4 May 2016 14:06:16 -0700 Subject: [PATCH] Always download coredistools package runtest.sh/cmd currently downloads the coredistools package if COMPlus_GCStress variable is set by TestEnv or test-env options. This is a bit complicated and this doesn't work with a new option for GC stress testing in build/buildtest.cmd. This changeset moves downloading the coredistools package to buildtest.cmd where it takes gcstress option and downloads other packages. Linux build doesn't have buildtest.sh, so package donwloading is still in runtest.sh --- build.sh | 2 -- tests/buildtest.cmd | 6 ++++++ tests/runtest.cmd | 12 ------------ tests/runtest.sh | 30 +----------------------------- tests/setup-runtime-dependencies.cmd | 4 ++++ 5 files changed, 11 insertions(+), 43 deletions(-) diff --git a/build.sh b/build.sh index 14d285b..fcd87de 100755 --- a/build.sh +++ b/build.sh @@ -293,8 +293,6 @@ build_mscorlib() fi } - - generate_NugetPackages() { # We can only generate nuget package if we also support building mscorlib as part of this build. diff --git a/tests/buildtest.cmd b/tests/buildtest.cmd index 5c0d688..08951a2 100644 --- a/tests/buildtest.cmd +++ b/tests/buildtest.cmd @@ -182,6 +182,12 @@ REM === REM ========================================================================================= call %__ProjectDir%\init-tools.cmd +REM ========================================================================================= +REM === +REM === Resolve runtime dependences +REM === +REM ========================================================================================= +call tests\setup-runtime-dependencies.cmd /arch %__BuildArch% /outputdir %__BinDir% REM ========================================================================================= REM === diff --git a/tests/runtest.cmd b/tests/runtest.cmd index d894c8e..e5f6262 100644 --- a/tests/runtest.cmd +++ b/tests/runtest.cmd @@ -300,18 +300,6 @@ if "%CORE_ROOT%" == "" ( echo %__MsgPrefix%Error: Ensure you have done a successful build of the Product and Run - runtest BuildArch BuildType {path to product binaries}. exit /b 1 ) -:: Pull down dependent packages needed for testing -setlocal -if defined __TestEnv call %__TestEnv% -if defined COMPlus_GCStress set __Result=true -endlocal & set __IsGCTest=%__Result% -if "%__IsGCTest%"=="true" ( - call tests\setup-runtime-dependencies.cmd /arch %__BuildArch% /outputdir %CORE_ROOT% - if errorlevel 1 ( - echo Failed to donwload runtime packages - exit /b 1 - ) -) :: Long GC tests take about 10 minutes per test on average, so :: they often bump up against the default 10 minute timeout. diff --git a/tests/runtest.sh b/tests/runtest.sh index 9550c7f..ab4c50d 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -866,36 +866,8 @@ else load_failing_tests fi - - scriptPath=$(dirname $0) - -# Check if environment variables are provided -if [ ! -z "$testEnv" ]; then - # Check if this is GC stress testing - GCStressLevel=`(source $testEnv; echo $COMPlus_GCStress)` - # Set __TestEnv that will be executed just before running tests - absTestEnvPath=`readlink -f ${testEnv}` - export __TestEnv='source '${absTestEnvPath} -fi - -# Still support setting COMPlus_GCStress before runtest.sh but recommend -# using --test-env option. -if [ -z "$GCStressLevel" ]; then - if [ -n "$COMPlus_GCStress" ]; then - GCStressLevel=`echo $COMPlus_GCStress` - fi -fi - -# Download runtime dependent libraries -if [ ! -z "$GCStressLevel" ]; then - ${scriptPath}/setup-runtime-dependencies.sh --outputDir=$coreOverlayDir - if [ $? -ne 0 ] - then - echo 'Failed to download coredistools library' - exit $EXIT_CODE_EXCEPTION - fi -fi +${scriptPath}/setup-runtime-dependencies.sh --outputDir=$coreOverlayDir cd "$testRootDir" if [ -z "$testDirectories" ] diff --git a/tests/setup-runtime-dependencies.cmd b/tests/setup-runtime-dependencies.cmd index 0913399..5b13d09 100755 --- a/tests/setup-runtime-dependencies.cmd +++ b/tests/setup-runtime-dependencies.cmd @@ -105,6 +105,10 @@ if not exist "%__LibPath%" ( REM Copy library to output directory echo Copy library: %__LibPath% to %__OutputDir% copy /y "%__LibPath%" "%__OutputDir%" +if errorlevel 1 ( + echo Failed to copy %__LibPath% to %__OutputDir% + goto Fail +) REM Delete temporary files if exist "%__TmpDir%" ( -- 2.7.4