diff options
author | Simon Nattress <nattress@gmail.com> | 2017-01-21 02:29:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-21 02:29:06 +0300 |
commit | a8e83020658bc908fe6f829fba828ec04905d440 (patch) | |
tree | 8e7b77d3c120b03cb0bc86bf60443b62383897d3 | |
parent | 56a82fa2f0784762adc44ce290afac6326a1018f (diff) | |
parent | 14e3ad3e69a77f925fd4d40b52be42c622eabcf3 (diff) |
Merge pull request #2553 from nattress/coreclrtests_unix
Run CoreCLR tests on Unix
-rw-r--r-- | netci.groovy | 1 | ||||
-rw-r--r-- | tests/CoreCLR/Test.csproj | 2 | ||||
-rwxr-xr-x | tests/CoreCLR/corerun | 30 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/CoreCLR/runtest/runtest.sh | 21 | ||||
-rw-r--r-- | tests/CoreCLR/runtest/testsFailingOutsideWindows.txt | 0 | ||||
-rw-r--r-- | tests/CoreCLR/runtest/testsUnsupportedOutsideWindows.txt | 0 | ||||
-rw-r--r-- | tests/Top200.unix.txt | 195 | ||||
-rwxr-xr-x | tests/runtest.sh | 93 |
8 files changed, 327 insertions, 15 deletions
diff --git a/netci.groovy b/netci.groovy index e6d1b990a..af7627fae 100644 --- a/netci.groovy +++ b/netci.groovy @@ -69,7 +69,6 @@ def osList = ['Ubuntu', 'OSX', 'Windows_NT'] if (configuration == 'Debug') { if (isPR) { - prJobDescription += " and CoreCLR tests" // Run a small set of BVTs during PR validation shell(testScriptString + "top200") } diff --git a/tests/CoreCLR/Test.csproj b/tests/CoreCLR/Test.csproj index 7d527b0f0..12021e49d 100644 --- a/tests/CoreCLR/Test.csproj +++ b/tests/CoreCLR/Test.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <TargetName>$(TestFileName)</TargetName> - <TargetExt>.Exe</TargetExt> + <TargetExt>.exe</TargetExt> <OutputType>Exe</OutputType> <OutputPath>$(MSBuildProjectDirectory)\</OutputPath> <IntermediateOutputPath>$(MSBuildProjectDirectory)\</IntermediateOutputPath> diff --git a/tests/CoreCLR/corerun b/tests/CoreCLR/corerun new file mode 100755 index 000000000..88a5eeb0c --- /dev/null +++ b/tests/CoreCLR/corerun @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +# This is the Unix equivalent of build-and-run-test.cmd +# It is invoked by each test's bash script. The reason it's called corerun is that +# the unix CoreCLR tests don't have a custom runner override environment variable. +# See issue https://github.com/dotnet/coreclr/issues/9007 + +export TestExecutable=$1 +export TestFileName=${TestExecutable%.*} + +cp $CoreRT_TestRoot/CoreCLR/Test.csproj . + +__msbuild_dir=${CoreRT_TestRoot}/../Tools +echo ${__msbuild_dir}/msbuild.sh /m /p:IlcPath=${CoreRT_ToolchainDir} /p:Configuration=${CoreRT_BuildType} Test.csproj +${__msbuild_dir}/msbuild.sh /m /p:IlcPath=${CoreRT_ToolchainDir} /p:Configuration=${CoreRT_BuildType} Test.csproj + +# Some tests (interop) have native artifacts they depend on. Copy all DLLs to be sure we have them. +cp *.dll native/ 2>/dev/null + +# Remove the test executable from the arg list so it isn't passed to test execution +shift + +native/${TestFileName} $* + +testScriptExitCode=$? + +# Clean up test binary artifacts to save space +rm -r native 2>/dev/null + +exit $testScriptExitCode diff --git a/tests/CoreCLR/runtest/runtest.sh b/tests/CoreCLR/runtest/runtest.sh index 0c1124f31..6e227ee42 100644..100755 --- a/tests/CoreCLR/runtest/runtest.sh +++ b/tests/CoreCLR/runtest/runtest.sh @@ -61,6 +61,7 @@ function print_usage { echo ' --build-overlay-only : Exit after overlay directory is populated' echo ' --limitedDumpGeneration : Enables the generation of a limited number of core dumps if test(s) crash, even if ulimit' echo ' is zero when launching this script. This option is intended for use in CI.' + echo ' --logdir=<log folder> : Specifies a folder to emit logs to. Default is test root folder.' echo '' echo 'Runtime Code Coverage options:' echo ' --coreclr-coverage : Optional argument to get coreclr code coverage reports' @@ -126,7 +127,7 @@ fi find . -type f -name "local_dumplings.txt" -exec rm {} \; function xunit_output_begin { - xunitOutputPath=$testRootDir/coreclrtests.xml + xunitOutputPath=$__LogDir/testResults.xml xunitTestOutputPath=${xunitOutputPath}.test if [ -e "$xunitOutputPath" ]; then rm -f -r "$xunitOutputPath" @@ -792,6 +793,12 @@ function finish_remaining_tests { function prep_test { local scriptFilePath=$1 + # Skip any test that's not in the current playlist, if a playlist was + # given to us. + if [ -n "$playlistFile" ] && ! is_playlist_test "$scriptFilePath"; then + return + fi + test "$verbose" == 1 && echo "Preparing $scriptFilePath" if [ ! "$noLFConversion" == "ON" ]; then @@ -1076,6 +1083,9 @@ do --limitedDumpGeneration) limitedCoreDumps=ON ;; + --logdir=*) + __LogDir=${i#*=} + ;; *) echo "Unknown switch: $i" print_usage @@ -1105,6 +1115,10 @@ if [ ! -d "$testRootDir" ]; then exit $EXIT_CODE_EXCEPTION fi +if [ -z "$__LogDir" ]; then + __LogDir=$testRootDir +fi + # Copy native interop test libraries over to the mscorlib path in # order for interop tests to run on linux. if [ -z "$mscorlibDir" ]; then @@ -1178,7 +1192,10 @@ fi if [ "$ARCH" == "x64" ] then scriptPath=$(dirname $0) - ${scriptPath}/setup-runtime-dependencies.sh --outputDir=$coreOverlayDir + # Disabled for CoreRT + # This is how CoreCLR sets up GCStress. We will probably go the .NET Native route + # when we get to GC Stress though. + #${scriptPath}/setup-runtime-dependencies.sh --outputDir=$coreOverlayDir else echo "Skip preparing for GC stress test. Dependent package is not supported on this architecture." fi diff --git a/tests/CoreCLR/runtest/testsFailingOutsideWindows.txt b/tests/CoreCLR/runtest/testsFailingOutsideWindows.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/CoreCLR/runtest/testsFailingOutsideWindows.txt diff --git a/tests/CoreCLR/runtest/testsUnsupportedOutsideWindows.txt b/tests/CoreCLR/runtest/testsUnsupportedOutsideWindows.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/CoreCLR/runtest/testsUnsupportedOutsideWindows.txt diff --git a/tests/Top200.unix.txt b/tests/Top200.unix.txt new file mode 100644 index 000000000..9215d296b --- /dev/null +++ b/tests/Top200.unix.txt @@ -0,0 +1,195 @@ +GC/Features/PartialCompaction/eco1/eco1.sh +GC/Features/PartialCompaction/partialcompactiontest/partialcompactiontest.sh +GC/Features/PartialCompaction/partialcompactionwloh/partialcompactionwloh.sh +GC/Scenarios/Boxing/vararystress/vararystress.sh +GC/Scenarios/Boxing/variantint/variantint.sh +GC/Scenarios/Boxing/variantlinklist/variantlinklist.sh +GC/Scenarios/GCBase1/gc_base1/gc_base1.sh +GC/Scenarios/GCBase1/gc_base1_1/gc_base1_1.sh +GC/Scenarios/GCBench/gcbench/gcbench.sh +GC/Scenarios/GCSimulator/GCSimulator_287/GCSimulator_287.sh +GC/Scenarios/GCSimulator/GCSimulator_288/GCSimulator_288.sh +GC/Scenarios/GCSimulator/GCSimulator_289/GCSimulator_289.sh +GC/Scenarios/GCSimulator/GCSimulator_29/GCSimulator_29.sh +GC/Scenarios/GCSimulator/GCSimulator_290/GCSimulator_290.sh +GC/Scenarios/GCSimulator/GCSimulator_291/GCSimulator_291.sh +GC/Scenarios/GCSimulator/GCSimulator_292/GCSimulator_292.sh +GC/Scenarios/GCSimulator/GCSimulator_293/GCSimulator_293.sh +GC/Scenarios/GCSimulator/GCSimulator_294/GCSimulator_294.sh +GC/Scenarios/SingLinkList/singlinkstay/singlinkstay.sh +JIT/CodeGenBringUpTests/addref/addref.sh +JIT/CodeGenBringUpTests/And1/And1.sh +JIT/CodeGenBringUpTests/AndRef/AndRef.sh +JIT/CodeGenBringUpTests/Args4/Args4.sh +JIT/CodeGenBringUpTests/Args5/Args5.sh +JIT/CodeGenBringUpTests/AsgAdd1/AsgAdd1.sh +JIT/CodeGenBringUpTests/AsgAnd1/AsgAnd1.sh +JIT/CodeGenBringUpTests/AsgOr1/AsgOr1.sh +JIT/CodeGenBringUpTests/AsgSub1/AsgSub1.sh +JIT/CodeGenBringUpTests/AsgXor1/AsgXor1.sh +JIT/CodeGenBringUpTests/BinaryRMW/BinaryRMW.sh +JIT/CodeGenBringUpTests/Call1/Call1.sh +JIT/CodeGenBringUpTests/CnsBool/CnsBool.sh +JIT/CodeGenBringUpTests/CnsLng1/CnsLng1.sh +JIT/CodeGenBringUpTests/DblAdd/DblAdd.sh +JIT/CodeGenBringUpTests/DblAddConst/DblAddConst.sh +JIT/CodeGenBringUpTests/DblArea/DblArea.sh +JIT/CodeGenBringUpTests/DblArray/DblArray.sh +JIT/CodeGenBringUpTests/DblAvg2/DblAvg2.sh +JIT/CodeGenBringUpTests/DblAvg6/DblAvg6.sh +JIT/CodeGenBringUpTests/DblCall1/DblCall1.sh +JIT/CodeGenBringUpTests/DblCall2/DblCall2.sh +JIT/CodeGenBringUpTests/DblDist/DblDist.sh +JIT/CodeGenBringUpTests/DblDiv/DblDiv.sh +JIT/CodeGenBringUpTests/DblDivConst/DblDivConst.sh +JIT/CodeGenBringUpTests/DblFillArray/DblFillArray.sh +JIT/CodeGenBringUpTests/DblMul/DblMul.sh +JIT/CodeGenBringUpTests/DblMulConst/DblMulConst.sh +JIT/CodeGenBringUpTests/DblNeg/DblNeg.sh +JIT/CodeGenBringUpTests/DblRem/DblRem.sh +JIT/CodeGenBringUpTests/DblRoots/DblRoots.sh +JIT/CodeGenBringUpTests/DblSub/DblSub.sh +JIT/CodeGenBringUpTests/DblSubConst/DblSubConst.sh +JIT/CodeGenBringUpTests/DblVar/DblVar.sh +JIT/CodeGenBringUpTests/div1/div1.sh +JIT/CodeGenBringUpTests/divref/divref.sh +JIT/CodeGenBringUpTests/Eq1/Eq1.sh +JIT/CodeGenBringUpTests/FactorialRec/FactorialRec.sh +JIT/CodeGenBringUpTests/FibLoop/FibLoop.sh +JIT/CodeGenBringUpTests/FiboRec/FiboRec.sh +JIT/CodeGenBringUpTests/FPAdd/FPAdd.sh +JIT/CodeGenBringUpTests/FPAddConst/FPAddConst.sh +JIT/CodeGenBringUpTests/FPArea/FPArea.sh +JIT/CodeGenBringUpTests/FPArray/FPArray.sh +JIT/CodeGenBringUpTests/FPAvg2/FPAvg2.sh +JIT/CodeGenBringUpTests/FPAvg6/FPAvg6.sh +JIT/CodeGenBringUpTests/FPCall1/FPCall1.sh +JIT/CodeGenBringUpTests/FPCall2/FPCall2.sh +JIT/CodeGenBringUpTests/FPConvDbl2Lng/FPConvDbl2Lng.sh +JIT/CodeGenBringUpTests/FPConvF2F/FPConvF2F.sh +JIT/CodeGenBringUpTests/FPConvF2I/FPConvF2I.sh +JIT/CodeGenBringUpTests/FPConvF2Lng/FPConvF2Lng.sh +JIT/CodeGenBringUpTests/FPConvI2F/FPConvI2F.sh +JIT/CodeGenBringUpTests/FPDist/FPDist.sh +JIT/CodeGenBringUpTests/FPDiv/FPDiv.sh +JIT/CodeGenBringUpTests/FPDivConst/FPDivConst.sh +JIT/CodeGenBringUpTests/FPError/FPError.sh +JIT/CodeGenBringUpTests/FPFillArray/FPFillArray.sh +JIT/CodeGenBringUpTests/FPMath/FPMath.sh +JIT/CodeGenBringUpTests/FPMul/FPMul.sh +JIT/CodeGenBringUpTests/FPMulConst/FPMulConst.sh +JIT/CodeGenBringUpTests/FPNeg/FPNeg.sh +JIT/CodeGenBringUpTests/FPRem/FPRem.sh +JIT/CodeGenBringUpTests/FPRoots/FPRoots.sh +JIT/CodeGenBringUpTests/FPSmall/FPSmall.sh +JIT/CodeGenBringUpTests/FPSub/FPSub.sh +JIT/CodeGenBringUpTests/FPSubConst/FPSubConst.sh +JIT/CodeGenBringUpTests/FPVar/FPVar.sh +JIT/CodeGenBringUpTests/Gcd/Gcd.sh +JIT/CodeGenBringUpTests/Ge1/Ge1.sh +JIT/CodeGenBringUpTests/Gt1/Gt1.sh +JIT/CodeGenBringUpTests/Ind1/Ind1.sh +JIT/CodeGenBringUpTests/InitObj/InitObj.sh +JIT/CodeGenBringUpTests/InstanceCalls/InstanceCalls.sh +JIT/CodeGenBringUpTests/IntArraySum/IntArraySum.sh +JIT/CodeGenBringUpTests/IntConv/IntConv.sh +JIT/CodeGenBringUpTests/Jmp1/Jmp1.sh +JIT/CodeGenBringUpTests/JTrue1/JTrue1.sh +JIT/CodeGenBringUpTests/JTrueEqDbl/JTrueEqDbl.sh +JIT/CodeGenBringUpTests/JTrueEqFP/JTrueEqFP.sh +JIT/CodeGenBringUpTests/JTrueEqInt1/JTrueEqInt1.sh +JIT/CodeGenBringUpTests/JTrueGeDbl/JTrueGeDbl.sh +JIT/CodeGenBringUpTests/JTrueGeFP/JTrueGeFP.sh +JIT/CodeGenBringUpTests/JTrueGeInt1/JTrueGeInt1.sh +JIT/CodeGenBringUpTests/JTrueGtDbl/JTrueGtDbl.sh +JIT/CodeGenBringUpTests/JTrueGtFP/JTrueGtFP.sh +JIT/CodeGenBringUpTests/JTrueGtInt1/JTrueGtInt1.sh +JIT/CodeGenBringUpTests/JTrueLeDbl/JTrueLeDbl.sh +JIT/CodeGenBringUpTests/JTrueLeFP/JTrueLeFP.sh +JIT/CodeGenBringUpTests/JTrueLeInt1/JTrueLeInt1.sh +JIT/CodeGenBringUpTests/JTrueLtDbl/JTrueLtDbl.sh +JIT/CodeGenBringUpTests/JTrueLtFP/JTrueLtFP.sh +JIT/CodeGenBringUpTests/JTrueLtInt1/JTrueLtInt1.sh +JIT/CodeGenBringUpTests/JTrueNeDbl/JTrueNeDbl.sh +JIT/CodeGenBringUpTests/JTrueNeFP/JTrueNeFP.sh +JIT/CodeGenBringUpTests/JTrueNeInt1/JTrueNeInt1.sh +JIT/CodeGenBringUpTests/Le1/Le1.sh +JIT/CodeGenBringUpTests/LeftShift/LeftShift.sh +JIT/CodeGenBringUpTests/LngConv/LngConv.sh +JIT/CodeGenBringUpTests/LongArgsAndReturn/LongArgsAndReturn.sh +JIT/CodeGenBringUpTests/Lt1/Lt1.sh +JIT/CodeGenBringUpTests/mul1/mul1.sh +JIT/CodeGenBringUpTests/mul2/mul2.sh +JIT/CodeGenBringUpTests/mul3/mul3.sh +JIT/CodeGenBringUpTests/mul4/mul4.sh +JIT/CodeGenBringUpTests/Ne1/Ne1.sh +JIT/CodeGenBringUpTests/NegRMW/NegRMW.sh +JIT/CodeGenBringUpTests/NestedCall/NestedCall.sh +JIT/CodeGenBringUpTests/NotAndNeg/NotAndNeg.sh +JIT/CodeGenBringUpTests/NotRMW/NotRMW.sh +JIT/CodeGenBringUpTests/ObjAlloc/ObjAlloc.sh +JIT/CodeGenBringUpTests/OpMembersOfStructLocal/OpMembersOfStructLocal.sh +JIT/CodeGenBringUpTests/Or1/Or1.sh +JIT/CodeGenBringUpTests/OrRef/OrRef.sh +JIT/CodeGenBringUpTests/rem1/rem1.sh +JIT/CodeGenBringUpTests/RightShiftRef/RightShiftRef.sh +JIT/CodeGenBringUpTests/Rotate/Rotate.sh +JIT/CodeGenBringUpTests/StaticCalls/StaticCalls.sh +JIT/CodeGenBringUpTests/StaticValueField/StaticValueField.sh +JIT/CodeGenBringUpTests/struct16args/struct16args.sh +JIT/CodeGenBringUpTests/StructFldAddr/StructFldAddr.sh +JIT/CodeGenBringUpTests/StructInstMethod/StructInstMethod.sh +JIT/CodeGenBringUpTests/Sub1/Sub1.sh +JIT/CodeGenBringUpTests/SubRef/SubRef.sh +JIT/CodeGenBringUpTests/Swap/Swap.sh +JIT/CodeGenBringUpTests/Switch/Switch.sh +JIT/CodeGenBringUpTests/Unbox/Unbox.sh +JIT/CodeGenBringUpTests/Xor1/Xor1.sh +JIT/CodeGenBringUpTests/XorRef/XorRef.sh +JIT/Directed/ExcepFilters/excepobj/excepobj/excepobj.sh +JIT/Directed/ExcepFilters/fault/fault/fault.sh +JIT/Directed/ExcepFilters/mixed/mixed/mixed.sh +JIT/Directed/nullabletypes/isinst_d/isinst_d.sh +JIT/Directed/nullabletypes/isinst_do/isinst_do.sh +Loader/classloader/generics/Layout/General/Base01a_auto/Base01a_auto.sh +Loader/classloader/generics/Layout/General/Base01a_auto_ser/Base01a_auto_ser.sh +Loader/classloader/generics/Layout/General/Base01a_seq/Base01a_seq.sh +Loader/classloader/generics/Layout/General/struct01_auto/struct01_auto.sh +Loader/classloader/generics/Layout/Specific/Positive007/Positive007.sh +Loader/classloader/generics/Layout/Specific/Positive008/Positive008.sh +Loader/classloader/generics/Layout/Specific/Positive009/Positive009.sh +Loader/classloader/generics/Layout/Specific/Positive010/Positive010.sh +Loader/classloader/generics/Misc/ConstraintsAndInheritance/ConstraintsAndInheritance.sh +Loader/classloader/generics/Misc/TestWithManyParams/TestWithManyParams.sh +Loader/classloader/generics/Statics/Regressions/524571/StaticsProblem1/StaticsProblem1.sh +Loader/classloader/generics/Statics/Regressions/524571/StaticsProblem2/StaticsProblem2.sh +Loader/classloader/generics/Statics/Regressions/524571/StaticsProblem3/StaticsProblem3.sh +Loader/classloader/InterfaceFolding/TestCase0/TestCase0.sh +Loader/classloader/InterfaceFolding/TestCase0_Nested_I/TestCase0_Nested_I.sh +Loader/classloader/InterfaceFolding/TestCase0_Nested_I_Nested_J/TestCase0_Nested_I_Nested_J.sh +Loader/classloader/InterfaceFolding/TestCase0_Nested_J/TestCase0_Nested_J.sh +Loader/classloader/InterfaceFolding/TestCase0_Nested_J_Nested_I/TestCase0_Nested_J_Nested_I.sh +Loader/classloader/InterfaceFolding/TestCase1/TestCase1.sh +Loader/classloader/InterfaceFolding/TestCase1_Nested_I/TestCase1_Nested_I.sh +Loader/classloader/InterfaceFolding/TestCase1_Nested_I_Nested_J/TestCase1_Nested_I_Nested_J.sh +Loader/classloader/InterfaceFolding/TestCase1_Nested_J/TestCase1_Nested_J.sh +Loader/classloader/InterfaceFolding/TestCase2/TestCase2.sh +Loader/classloader/InterfaceFolding/TestCase2_Nested_I/TestCase2_Nested_I.sh +Loader/classloader/InterfaceFolding/TestCase2_Nested_I_Nested_J/TestCase2_Nested_I_Nested_J.sh +Loader/classloader/InterfaceFolding/TestCase2_Nested_J/TestCase2_Nested_J.sh +Loader/classloader/InterfaceFolding/TestCase2_Nested_J_Nested_I/TestCase2_Nested_J_Nested_I.sh +Loader/classloader/regressions/dev10_568786/4_Misc/ConstrainedMethods/ConstrainedMethods.sh +Loader/classloader/regressions/dev10_568786/4_Misc/RecursiveGen/RecursiveGen.sh +Loader/classloader/TSAmbiguities/Variance/Covariant_CollapsedInterfaces/HelloWorld/HelloWorld.sh +Loader/classloader/TSAmbiguities/Variance/Covariant_InherittedCollision/HelloWorld/HelloWorld.sh +Loader/classloader/TSAmbiguities/Variance/Variant_CollapsedInterfaces/HelloWorld/HelloWorld.sh +Loader/classloader/TSAmbiguities/Variance/Variant_InherittedCollision/HelloWorld/HelloWorld.sh +Loader/classloader/v1/Beta1/Layout/Matrix/cs/L-1-2-1/L-1-2-1.sh +Regressions/expl_double/expl_double/expl_double.sh +JIT/CodeGenBringUpTests/Localloc/Localloc.sh +JIT/CodeGenBringUpTests/UDivConst/UDivConst.sh +JIT/CodeGenBringUpTests/UModConst/UModConst.sh +JIT/Directed/FaultHandlers/Nesting/Nesting/Nesting.sh +Loader/classloader/TypeInitialization/CctorsWithSideEffects/CctorThrowStaticField/CctorThrowStaticField.sh +JIT/jit64/localloc/eh/eh01_dynamic/eh01_dynamic.sh +JIT/Regression/JitBlue/DevDiv_142976/DevDiv_142976/DevDiv_142976.sh
\ No newline at end of file diff --git a/tests/runtest.sh b/tests/runtest.sh index 2593515fb..09a44946f 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -2,11 +2,15 @@ usage() { - echo "Usage: $0 [OS] [arch] [flavor] [-extrepo] [-buildextrepo] [-mode] [-runtest]" + echo "Usage: $0 [OS] [arch] [flavor] [-mode] [-runtest] [-coreclr <subset>]" echo " -mode : Compilation mode. Specify cpp/ryujit. Default: ryujit" echo " -runtest : Should just compile or run compiled binary? Specify: true/false. Default: true." - echo " -extrepo : Path to external repo, currently supports: GitHub: dotnet/coreclr. Specify full path. If unspecified, runs corert tests" - echo " -buildextrepo : Should build at root level of external repo? Specify: true/false. Default: true" + echo " -coreclr : Download and run the CoreCLR repo tests" + echo "" + echo " --- CoreCLR Subset ---" + echo " top200 : Runs broad coverage / CI validation (~200 tests)." + echo " knowngood : Runs tests known to pass on CoreRT (~6000 tests)." + echo " all : Runs all tests. There will be many failures (~7000 tests)." exit 1 } @@ -55,14 +59,69 @@ run_test_dir() return $? } +restore_coreclr_tests() +{ + CoreRT_Test_Download_Semaphore=${CoreRT_TestExtRepo}/init-tests.completed + + if [ -e ${CoreRT_Test_Download_Semaphore} ]; then + echo "Tests are already initialized." + return 0 + fi + + if [ -d ${CoreRT_TestExtRepo} ]; then + rm -r ${CoreRT_TestExtRepo} + fi + mkdir -p ${CoreRT_TestExtRepo} + + echo "Restoring tests (this may take a few minutes).." + TESTS_REMOTE_URL=$(<${CoreRT_TestRoot}/../CoreCLRTestsURL.txt) + TESTS_LOCAL_ZIP=${CoreRT_TestExtRepo}/tests.zip + curl --retry 10 --retry-delay 5 -sSL -o ${TESTS_LOCAL_ZIP} ${TESTS_REMOTE_URL} + + unzip -q ${TESTS_LOCAL_ZIP} -d ${CoreRT_TestExtRepo} + + echo "CoreCLR tests restored from ${TESTS_REMOTE_URL}" >> ${CoreRT_Test_Download_Semaphore} +} + +run_coreclr_tests() +{ + if [ -z ${CoreRT_TestExtRepo} ]; then + CoreRT_TestExtRepo=${CoreRT_TestRoot}/../tests_downloaded/CoreCLR + fi + + restore_coreclr_tests + + if [ ! -d ${CoreRT_TestExtRepo} ]; then + echo "Error: ${CoreRT_TestExtRepo} does not exist." + exit -1 + fi + + XunitTestBinBase=${CoreRT_TestExtRepo} + CORE_ROOT=${CoreRT_TestRoot}/CoreCLR/runtest + pushd ${CoreRT_TestRoot}/CoreCLR/runtest + + export CoreRT_TestRoot + + CoreRT_TestSelectionArg= + if [ "$SelectedTests" = "top200" ]; then + CoreRT_TestSelectionArg="--playlist=${CoreRT_TestRoot}/Top200.unix.txt" + elif [ "$SelectedTests" = "knowngood" ]; then + # Todo: Build the list of tests that pass + CoreRT_TestSelectionArg= + elif [ "$SelectedTests" = "all" ]; then + CoreRT_TestSelectionArg= + fi + + echo ./runtest.sh --testRootDir=${CoreRT_TestExtRepo} --coreOverlayDir=${CoreRT_TestRoot}/CoreCLR ${CoreRT_TestSelectionArg} --logdir=$__LogDir + ./runtest.sh --testRootDir=${CoreRT_TestExtRepo} --coreOverlayDir=${CoreRT_TestRoot}/CoreCLR ${CoreRT_TestSelectionArg} --logdir=$__LogDir +} + CoreRT_TestRoot="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CoreRT_CliBinDir=${CoreRT_TestRoot}/../Tools/dotnetcli CoreRT_BuildArch=x64 CoreRT_BuildType=Debug CoreRT_TestRun=true CoreRT_TestCompileMode=ryujit -CoreRT_TestExtRepo= -CoreRT_BuildExtRepo= while [ "$1" != "" ]; do lowerI="$(echo $1 | awk '{print tolower($0)}')" @@ -89,10 +148,6 @@ while [ "$1" != "" ]; do release) CoreRT_BuildType=Release ;; - -extrepo) - shift - CoreRT_TestExtRepo=$1 - ;; -mode) shift CoreRT_TestCompileMode=$1 @@ -106,9 +161,16 @@ while [ "$1" != "" ]; do CoreRT_CliBinDir=$1 ;; -coreclr) + CoreRT_RunCoreCLRTests=true; shift - echo "Tests will run here. For now, early out." - exit 0 + SelectedTests=$1 + + if [ -z ${SelectedTests} ]; then + SelectedTests=top200 + elif [ "${SelectedTests}" != "all" ] && [ "${SelectedTests}" != "top200" ] && [ "${SelectedTests}" != "knowngood" ]; then + echo "Error: Invalid CoreCLR test selection." + exit -1 + fi ;; *) ;; @@ -123,11 +185,20 @@ __CoreRTTestBinDir=${CoreRT_TestRoot}/../bin/tests __LogDir=${CoreRT_TestRoot}/../bin/Logs/${__BuildStr}/tests __build_os_lowcase=$(echo "${CoreRT_BuildOS}" | tr '[:upper:]' '[:lower:]') +if [ ! -d $__LogDir ]; then + mkdir -p $__LogDir +fi + if [ ! -d ${CoreRT_ToolchainDir} ]; then echo "Toolchain not found in ${CoreRT_ToolchainDir}" exit -1 fi +if [ ${CoreRT_RunCoreCLRTests} ]; then + run_coreclr_tests + exit $? +fi + __CppTotalTests=0 __CppPassedTests=0 __JitTotalTests=0 |