summaryrefslogtreecommitdiff
path: root/tests/runtest.sh
diff options
context:
space:
mode:
authorSean Gillespie <segilles@microsoft.com>2016-04-21 14:12:50 -0700
committerSean Gillespie <segilles@microsoft.com>2016-04-22 10:08:52 -0700
commit25aab635b4640ff5cacb28da993a6931146ad8ea (patch)
tree381aa9e9728cc9a4063fd54ed93251bcd96edf72 /tests/runtest.sh
parent527183caeb111b80081aff736b5fd2d3155e6e60 (diff)
downloadcoreclr-25aab635b4640ff5cacb28da993a6931146ad8ea.tar.gz
coreclr-25aab635b4640ff5cacb28da993a6931146ad8ea.tar.bz2
coreclr-25aab635b4640ff5cacb28da993a6931146ad8ea.zip
Add a "playlists" flag to runtests.sh that will run a list of tests
Diffstat (limited to 'tests/runtest.sh')
-rwxr-xr-xtests/runtest.sh55
1 files changed, 52 insertions, 3 deletions
diff --git a/tests/runtest.sh b/tests/runtest.sh
index 8cf2603cee..369d5f2f0d 100755
--- a/tests/runtest.sh
+++ b/tests/runtest.sh
@@ -37,6 +37,8 @@ function print_usage {
echo ' line, as paths to .sh files relative to the directory specified by --testRootDir.'
echo ' --disableEventLogging : Disable the events logged by both VM and Managed Code'
echo ' --sequential : Run tests sequentially (default is to run in parallel).'
+ echo ' --playlist=<path> : Run only the tests that are specified in the file at <path>, in the same format as'
+ echo ' runFailingTestsOnly'
echo ' -v, --verbose : Show output from each test.'
echo ' -h|--help : Show usage information.'
echo ' --useServerGC : Enable server GC for this test run'
@@ -409,6 +411,7 @@ function copy_test_native_bin_to_test_root {
# Variables for unsupported and failing tests
declare -a unsupportedTests
declare -a failingTests
+declare -a playlistTests
((runFailingTestsOnly = 0))
function load_unsupported_tests {
@@ -427,6 +430,13 @@ function load_failing_tests {
done <"$(dirname "$0")/testsFailingOutsideWindows.txt"
}
+function load_playlist_tests {
+ # Load the list of tests that are enabled as a part of this test playlist.
+ while IFS='' read -r line || [ -n "$line" ]; do
+ playlistTests[${#playlistTests[@]}]=$line
+ done <"${playlistFile}"
+}
+
function is_unsupported_test {
for unsupportedTest in "${unsupportedTests[@]}"; do
if [ "$1" == "$unsupportedTest" ]; then
@@ -445,6 +455,15 @@ function is_failing_test {
return 1
}
+function is_playlist_test {
+ for playlistTest in "${playlistTests[@]}"; do
+ if [ "$1" == "$playlistTest" ]; then
+ return 0
+ fi
+ done
+ return 1
+}
+
function skip_unsupported_test {
# This function runs in a background process. It should not echo anything, and should not use global variables. This
# function is analogous to run_test, and causes the test to be skipped with the message below.
@@ -467,6 +486,17 @@ function skip_failing_test {
return 2 # skip the test
}
+function skip_non_playlist_test {
+ # This function runs in a background process. It should not echo anything, and should not use global variables. This
+ # function is analogous to run_test, and causes the test to be skipped with the message below.
+
+ local scriptFilePath=$1
+ local outputFilePath=$2
+
+ echo "Test is not included in the running playlist." >"$outputFilePath"
+ return 2 # skip the test
+}
+
function run_test {
# This function runs in a background process. It should not echo anything, and should not use global variables.
@@ -553,10 +583,15 @@ function finish_remaining_tests {
function start_test {
local scriptFilePath=$1
-
if ((runFailingTestsOnly == 1)) && ! is_failing_test "$scriptFilePath"; then
return
fi
+
+ # 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
if ((nextProcessIndex < processCount)); then
finish_test
@@ -655,6 +690,7 @@ coreClrObjs=
coreClrSrc=
coverageOutputDir=
testEnv=
+playlistFile=
((disableEventLogging = 0))
((serverGC = 0))
@@ -715,6 +751,9 @@ do
--useServerGC)
((serverGC = 1))
;;
+ --playlist=*)
+ playlistFile=${i#*=}
+ ;;
--coreclr-coverage)
CoreClrCoverage=ON
;;
@@ -797,8 +836,18 @@ xunit_output_begin
create_core_overlay
precompile_overlay_assemblies
copy_test_native_bin_to_test_root
-load_unsupported_tests
-load_failing_tests
+
+if [ -n "$playlistFile" ]
+then
+ # Use a playlist file exclusively, if it was provided
+ echo "Executing playlist $playlistFile"
+ load_playlist_tests
+else
+ load_unsupported_tests
+ load_failing_tests
+fi
+
+
scriptPath=$(dirname $0)