summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSejong Oh <sejooh@microsoft.com>2016-03-10 23:31:18 -0800
committerSejong Oh <sejooh@microsoft.com>2016-03-10 23:31:18 -0800
commit586ce538403c1b859f73d97abec9bb4bfad4cab7 (patch)
treeaf17e18ec55898a0eccc11bb1d37d0a4fc51dab7 /tests
parentefc4eba1b0f05fe7da21c83221e856a53cee6f34 (diff)
parentae020a10676a04c12a0c3aa1265069e37b0296e5 (diff)
downloadcoreclr-586ce538403c1b859f73d97abec9bb4bfad4cab7.tar.gz
coreclr-586ce538403c1b859f73d97abec9bb4bfad4cab7.tar.bz2
coreclr-586ce538403c1b859f73d97abec9bb4bfad4cab7.zip
Merge pull request #3630 from sejongoh/pull_down_coredistool_windows
Pull down coredistool package on Windows
Diffstat (limited to 'tests')
-rw-r--r--tests/runtest.cmd10
-rwxr-xr-xtests/runtest.sh2
-rw-r--r--tests/setup-runtime-dependencies.cmd111
-rwxr-xr-xtests/setup-runtime-dependencies.sh (renamed from tests/setup-gcstress.sh)7
4 files changed, 124 insertions, 6 deletions
diff --git a/tests/runtest.cmd b/tests/runtest.cmd
index d564fa1313..e0a512b4d3 100644
--- a/tests/runtest.cmd
+++ b/tests/runtest.cmd
@@ -177,6 +177,15 @@ xcopy /s "%__BinDir%" "%CORE_ROOT%"
:SkipCoreRootSetup
+:: 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 /outputdir %CORE_ROOT%
+)
+
set __BuildLogRootName=TestRunResults
call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:NoBuild=true /clp:showcommandline
@@ -186,6 +195,7 @@ if errorlevel 1 (
exit /b 1
)
+
REM =========================================================================================
REM ===
REM === All tests complete!
diff --git a/tests/runtest.sh b/tests/runtest.sh
index 309ad83190..2366da20ed 100755
--- a/tests/runtest.sh
+++ b/tests/runtest.sh
@@ -758,7 +758,7 @@ load_failing_tests
if [ -n "$COMPlus_GCStress" ]; then
scriptPath=$(dirname $0)
- ${scriptPath}/setup-gcstress.sh --outputDir=$coreOverlayDir
+ ${scriptPath}/setup-runtime-dependencies.sh --outputDir=$coreOverlayDir
if [ $? -ne 0 ]
then
echo 'Failed to download coredistools library'
diff --git a/tests/setup-runtime-dependencies.cmd b/tests/setup-runtime-dependencies.cmd
new file mode 100644
index 0000000000..e7d6099b8d
--- /dev/null
+++ b/tests/setup-runtime-dependencies.cmd
@@ -0,0 +1,111 @@
+@if not defined __echo @echo off
+setlocal
+
+set __ThisScriptShort=%0
+set __ThisScriptFull=%~f0
+set __ThisScriptPath=%~dp0
+
+REM =========================================================================================
+REM ===
+REM === Parse arguments
+REM ===
+REM =========================================================================================
+
+set __OutputDir=
+
+:Arg_Loop
+if "%1" == "" goto ArgsDone
+
+if /i "%1" == "/?" goto Usage
+if /i "%1" == "-?" goto Usage
+if /i "%1" == "/h" goto Usage
+if /i "%1" == "-h" goto Usage
+if /i "%1" == "/help" goto Usage
+if /i "%1" == "-help" goto Usage
+
+if /i "%1" == "/outputdir" (set __OutputDir=%2&shift&shift&goto Arg_Loop)
+
+echo Invalid command-line argument: %1
+goto Usage
+
+:ArgsDone
+
+if not defined __OutputDir goto Usage
+
+
+REM =========================================================================================
+REM ===
+REM === Check if dotnet CLI and necessary directories exist
+REM ===
+REM =========================================================================================
+
+set __DotNetToolDir=%__ThisScriptPath%..\Tools
+set __DotNetCmd=%__DotNetToolDir%\dotnetcli\bin\dotnet.exe
+set __PackageDir=%__ThisScriptPath%..\Packages
+set __JasonFilePath=%__ThisScriptPath%project.json
+
+REM Check if dotnet CLI exists
+if not exist "%__DotNetToolDir%" (
+ echo Directory containing dotnet CLI does not exist: %__DotNetToolDir%
+ exit /b 1
+)
+if not exist "%__DotNetCmd%" (
+ echo dotnet.exe does not exist: %__DotNetCmd%
+ exit /b 1
+)
+
+REM Create directories needed
+if not exist "%__PackageDir%" md "%__PackageDir%"
+if not exist "%__OutputDir%" md "%__OutputDir%"
+
+
+REM =========================================================================================
+REM ===
+REM === Download packages
+REM ===
+REM =========================================================================================
+
+REM Write dependency information to project.json
+echo { ^
+ "dependencies": { ^
+ "Microsoft.NETCore.CoreDisTools": "1.0.0-prerelease-00001" ^
+ }, ^
+ "frameworks": { "dnxcore50": { } } ^
+ } > "%__JasonFilePath%"
+
+REM Download the package
+echo Downloading CoreDisTools package
+echo on
+call "%__DotNetCmd%" restore "%__JasonFilePath%" --source https://dotnet.myget.org/F/dotnet-core/ --packages "%__PackageDir%"
+@echo off
+
+REM Get downloaded dll path
+FOR /F "delims=" %%i IN ('dir coredistools.dll /b/s') DO set __LibPath=%%i
+if not exist "%__LibPath%" (
+ echo Failed to locate the downloaded library: %__LibPath%
+ exit /b 1
+)
+
+REM Copy library to output directory
+echo Copy library: %__LibPath% to %__OutputDir%
+copy /y "%__LibPath%" "%__OutputDir%"
+
+REM Delete temporary files
+del "%__JasonFilePath%"
+
+exit /b 0
+
+REM =========================================================================================
+REM ===
+REM === Helper routines
+REM ===
+REM =========================================================================================
+
+:Usage
+echo.
+echo Download coredistool for GC stress testing
+echo.
+echo Usage:
+echo %__ThisScriptShort% /outputdir ^<coredistools_lib_install_path^>
+echo.
+exit /b 1
diff --git a/tests/setup-gcstress.sh b/tests/setup-runtime-dependencies.sh
index 4d141b5e36..9bd1003e54 100755
--- a/tests/setup-gcstress.sh
+++ b/tests/setup-runtime-dependencies.sh
@@ -83,15 +83,12 @@ echo { \
\"frameworks\": { \"dnxcore50\": { } } \
} > $jsonFilePath
-# Find runtime id
-rid=`$dotnetCmd --version | grep 'Runtime Id:' | sed 's/^ *Runtime Id: *//g'`
-
# Download the package
echo Downloading CoreDisTools package
-bash -c -x "$dotnetCmd restore $jsonFilePath --source https://dotnet.myget.org/F/dotnet-core/ --packages $packageDir --runtime $rid"
+bash -c -x "$dotnetCmd restore $jsonFilePath --source https://dotnet.myget.org/F/dotnet-core/ --packages $packageDir"
# Get library path
-libPath=`find $packageDir | grep $rid | grep -m 1 libcoredistools`
+libPath=`find $packageDir | grep -m 1 libcoredistools`
if [ ! -e $libPath ]; then
echo 'Failed to locate the downloaded library'
exit 1