diff options
-rw-r--r-- | TEST_MAPPING | 12 | ||||
-rwxr-xr-x | test/utils/regen-test-files | 44 |
2 files changed, 48 insertions, 8 deletions
diff --git a/TEST_MAPPING b/TEST_MAPPING index 3a8c9763b6..82bf09a377 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -10,16 +10,17 @@ // ART gtests. { "name": "ArtGtestsTarget" - } - ], - "postsubmit": [ + }, // ART run-tests. { "name": "art-run-test-001-HelloWorld" }, { "name": "art-run-test-001-Main" - }, + } + ], + "postsubmit": [ + // ART run-tests. { "name": "art-run-test-002-sleep" }, @@ -384,6 +385,9 @@ "name": "art-run-test-2030-long-running-child" }, { + "name": "art-run-test-2037-thread-name-inherit" + }, + { "name": "art-run-test-300-package-override" }, { diff --git a/test/utils/regen-test-files b/test/utils/regen-test-files index 34239e4982..b47aa4e914 100755 --- a/test/utils/regen-test-files +++ b/test/utils/regen-test-files @@ -263,6 +263,12 @@ known_failing_tests=( art-run-test-997-single-step ) +# Percentage of ART run-tests (among the ones expected to succeed) to include in +# the `presubmit` test group in `TEST_MAPPING` file -- the rest will be included +# in `postsubmit` test group. +# Currently, this value has to be a number between 1 and 99. +presubmit_tests_percentage=1 + cd "$ANDROID_BUILD_TOP/art" tests_dir=test @@ -349,6 +355,8 @@ echo "Generated Blueprint files for ${#handled_tests[@]} ART run-tests ouf of $n # Regenerate `TEST_MAPPING` file. # ------------------------------- +# Note: We only include ART run-tests expected to succeed for now. + # Complement of `known_failing_tests` in `handled_tests`. declare -a expected_succeeding_tests for run_test in "${handled_tests[@]}"; do @@ -367,6 +375,10 @@ done cat >TEST_MAPPING <<EOF // Generated by \`$me\`. Do not edit manually. { +EOF + +# Presubmits. +cat >>TEST_MAPPING <<EOF "presubmit": [ { "name": "CtsJdwpTestCases" @@ -377,14 +389,32 @@ cat >TEST_MAPPING <<EOF // ART gtests. { "name": "ArtGtestsTarget" - } + }, + // ART run-tests. +EOF +num_presubmit_tests=$((${#expected_succeeding_tests[@]} * $presubmit_tests_percentage / 100)) +trailer=, +for ((i=0; i < $num_presubmit_tests; ++i)); do + # Do not print a trailing comma for the last test (JSON does not allow + # superfluous trailing commas). + [[ $((i + 1)) -eq $num_presubmit_tests ]] && trailer= + cat >>TEST_MAPPING <<EOF + { + "name": "${expected_succeeding_tests[$i]}" + }$trailer +EOF +done +cat >>TEST_MAPPING <<EOF ], +EOF + +# Postsubmits. +cat >>TEST_MAPPING <<EOF "postsubmit": [ // ART run-tests. EOF -# Only include tests expected to succeed for now. trailer=, -for ((i=0; i < ${#expected_succeeding_tests[@]}; ++i)); do +for ((i=$num_presubmit_tests; i < ${#expected_succeeding_tests[@]}; ++i)); do # Do not print a trailing comma for the last test (JSON does not allow # superfluous trailing commas). [[ $((i + 1)) -eq ${#expected_succeeding_tests[@]} ]] && trailer= @@ -394,6 +424,7 @@ for ((i=0; i < ${#expected_succeeding_tests[@]}; ++i)); do }$trailer EOF done + # Epilogue. cat >>TEST_MAPPING <<EOF ] @@ -402,5 +433,10 @@ EOF expected_succeeding_tests_percentage=$((${#expected_succeeding_tests[@]} * 100 / num_tests)) +num_postsubmit_tests=$((${#expected_succeeding_tests[@]} - $num_presubmit_tests)) +postsubmit_tests_percentage=$((100 - $presubmit_tests_percentage)) + echo "Generated TEST_MAPPING entries for ${#expected_succeeding_tests[@]} ART run-tests ouf of" \ - "$num_tests ($expected_succeeding_tests_percentage%)." + "$num_tests ($expected_succeeding_tests_percentage%):" +echo " $num_presubmit_tests tests ($presubmit_tests_percentage%) in \`presubmit\` test group;" +echo " $num_postsubmit_tests tests ($postsubmit_tests_percentage%) in \`postsubmit\` test group." |