diff options
author | Sejong OH <sejooh@microsoft.com> | 2016-03-30 18:23:15 -0700 |
---|---|---|
committer | Sejong Oh <sejooh@microsoft.com> | 2016-03-31 02:22:21 -0700 |
commit | 7bbd985be6eb703a2e6f3822acae68c7305dd325 (patch) | |
tree | adcf56611dcb3d4ba122f9c0ab0e75328ebc6870 /tests | |
parent | d3502c29c511292d0c6046b1aafe87295d2372d9 (diff) | |
download | coreclr-7bbd985be6eb703a2e6f3822acae68c7305dd325.tar.gz coreclr-7bbd985be6eb703a2e6f3822acae68c7305dd325.tar.bz2 coreclr-7bbd985be6eb703a2e6f3822acae68c7305dd325.zip |
Fix tests/setup-runtime-dependencies.sh as per dotnet cli changes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runtest.cmd | 7 | ||||
-rwxr-xr-x | tests/setup-runtime-dependencies.cmd | 14 | ||||
-rwxr-xr-x | tests/setup-runtime-dependencies.sh | 13 |
3 files changed, 27 insertions, 7 deletions
diff --git a/tests/runtest.cmd b/tests/runtest.cmd index 80ed02691a..3979486050 100644 --- a/tests/runtest.cmd +++ b/tests/runtest.cmd @@ -286,8 +286,13 @@ 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% + tests\setup-runtime-dependencies.cmd /arch %__BuildArch% /outputdir %CORE_ROOT% + if errorlevel 1 ( + echo Failed to donwload runtime packages + exit /b 1 + ) ) + set __BuildLogRootName=Tests_GenerateRuntimeLayout call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:GenerateRuntimeLayout=true if errorlevel 1 ( diff --git a/tests/setup-runtime-dependencies.cmd b/tests/setup-runtime-dependencies.cmd index 6c7f6d10b1..f982d939c6 100755 --- a/tests/setup-runtime-dependencies.cmd +++ b/tests/setup-runtime-dependencies.cmd @@ -12,6 +12,7 @@ REM === REM ========================================================================================= set __OutputDir= +set __Arch= :Arg_Loop if "%1" == "" goto ArgsDone @@ -23,6 +24,7 @@ if /i "%1" == "-h" goto Usage if /i "%1" == "/help" goto Usage if /i "%1" == "-help" goto Usage +if /i "%1" == "/arch" (set __Arch=%2&shift&shift&goto Arg_Loop) if /i "%1" == "/outputdir" (set __OutputDir=%2&shift&shift&goto Arg_Loop) echo Invalid command-line argument: %1 @@ -31,7 +33,7 @@ goto Usage :ArgsDone if not defined __OutputDir goto Usage - +if not defined __Arch goto Usage REM ========================================================================================= REM === @@ -40,7 +42,7 @@ REM === REM ========================================================================================= set __DotNetToolDir=%__ThisScriptPath%..\Tools -set __DotNetCmd=%__DotNetToolDir%\dotnetcli\bin\dotnet.exe +set __DotNetCmd=%__DotNetToolDir%\dotnetcli\dotnet.exe set __PackageDir=%__ThisScriptPath%..\Packages set __TmpDir=%Temp%\coreclr_gcstress_%RANDOM% @@ -87,6 +89,12 @@ set DOTNETCMD="%__DotNetCmd%" restore "%__JasonFilePath%" --source https://dotne echo %DOTNETCMD% call %DOTNETCMD% if errorlevel 1 goto Fail +REM Get downloaded dll path +FOR /F "delims=" %%i IN ('dir %__PackageDir%\coredistools.dll /b/s ^| findstr /R "runtime.win[0-9]*-%__Arch%"') DO set __LibPath=%%i +if not exist "%__LibPath%" ( + echo Failed to locate the downloaded library: %__LibPath% + goto Fail +) REM Get downloaded dll path FOR /F "delims=" %%i IN ('dir %__PackageDir%\coredistools.dll /b/s') DO set __LibPath=%%i @@ -123,6 +131,6 @@ echo. echo Download coredistool for GC stress testing echo. echo Usage: -echo %__ThisScriptShort% /outputdir ^<coredistools_lib_install_path^> +echo %__ThisScriptShort% /arch ^<TargetArch^> /outputdir ^<coredistools_lib_install_path^> echo. exit /b 1 diff --git a/tests/setup-runtime-dependencies.sh b/tests/setup-runtime-dependencies.sh index 17fbb16334..457636cdc2 100755 --- a/tests/setup-runtime-dependencies.sh +++ b/tests/setup-runtime-dependencies.sh @@ -87,7 +87,7 @@ fi # This script must be located in coreclr/tests. scriptDir=$(cd "$(dirname "$0")"; pwd -P) dotnetToolsDir=$scriptDir/../Tools -dotnetCmd=${dotnetToolsDir}/dotnetcli/bin/dotnet +dotnetCmd=${dotnetToolsDir}/dotnetcli/dotnet packageDir=${scriptDir}/../packages jsonFilePath=${tmpDirPath}/project.json @@ -109,10 +109,17 @@ if [ ! -e $libInstallDir ]; then mkdir -p $libInstallDir fi +# Query runtime Id +rid=`$dotnetCmd --info | grep 'RID:' | sed 's/^ *RID: *//g'` +if [ -z "$rid" ]; then + exit_with_error 1 "Failed to query runtime Id" +fi + # Write dependency information to project.json +packageName='runtime.'$rid'.Microsoft.NETCore.CoreDisTools' echo { \ \"dependencies\": { \ - \"Microsoft.NETCore.CoreDisTools\": \"1.0.0-prerelease-00001\" \ + \"$packageName\": \"1.0.0-prerelease-00001\" \ }, \ \"frameworks\": { \"dnxcore50\": { } } \ } > $jsonFilePath @@ -126,7 +133,7 @@ then fi # Get library path -libPath=`find $packageDir | grep -m 1 libcoredistools` +libPath=`find $packageDir | grep $rid | grep -m 1 libcoredistools` if [ ! -e $libPath ]; then exit_with_error 1 'Failed to locate the downloaded library' fi |