diff options
author | 2022-10-19 11:21:21 +0100 | |
---|---|---|
committer | 2022-10-21 10:41:48 +0100 | |
commit | 63538502dd23150fbb6b027411c896e741ffc7f3 (patch) | |
tree | 4f060a933d7ffba8e6e6ae2b000c4e86a190e941 | |
parent | f767f7384bed37df5183abee9e15cefe352d297e (diff) |
Simplify run-test check scripts
The check scripts should use sed to modify the output in place.
(rather then generating temporary files)
The diff execution is moved to "run-test", always operates
on the standard file names, and must always succeed.
Test: ./art/test.py -r --all-target
Change-Id: I92666d78054dc98df07de3f6ed0a047b7f5b8682
42 files changed, 61 insertions, 157 deletions
diff --git a/TEST_MAPPING b/TEST_MAPPING index f7fa82818b..06a8b68cd5 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -413,9 +413,6 @@ "name": "art-run-test-2231-checker-heap-poisoning[com.google.android.art.apex]" }, { - "name": "art-run-test-2232-write-metrics-to-log[com.google.android.art.apex]" - }, - { "name": "art-run-test-2233-checker-remove-loop-suspend-check[com.google.android.art.apex]" }, { @@ -1747,9 +1744,6 @@ "name": "art-run-test-2231-checker-heap-poisoning" }, { - "name": "art-run-test-2232-write-metrics-to-log" - }, - { "name": "art-run-test-2233-checker-remove-loop-suspend-check" }, { @@ -3075,9 +3069,6 @@ "name": "art-run-test-2231-checker-heap-poisoning" }, { - "name": "art-run-test-2232-write-metrics-to-log" - }, - { "name": "art-run-test-2233-checker-remove-loop-suspend-check" }, { diff --git a/test/004-ThreadStress/check b/test/004-ThreadStress/check index f389e6b3a0..09a15b4c62 100755 --- a/test/004-ThreadStress/check +++ b/test/004-ThreadStress/check @@ -21,10 +21,9 @@ # $4: Test's actual standard error # Do not compare numbers, so replace numbers with 'N'. +sed -i 's/[0-9][0-9]*/N/g' "$2" + # Remove all messages relating to failing to allocate a java-peer for the # shutdown thread. This can occasionally happen with this test but it is not # something we really need to worry about here. -sed '-es/[0-9][0-9]*/N/g' "$2" \ - | diff --strip-trailing-cr -q "$1" - >/dev/null \ - && grep -v "Exception creating thread peer:" "$4" \ - | diff --strip-trailing-cr -q "$3" - >/dev/null +sed -i '/Exception creating thread peer:/d' "$4" diff --git a/test/099-vmdebug/check b/test/099-vmdebug/check index 3d9218891a..c2de81fb1d 100755 --- a/test/099-vmdebug/check +++ b/test/099-vmdebug/check @@ -21,7 +21,4 @@ # $4: Test's actual standard error # Strip the process pids and line numbers from exact error messages. -sed -e '/^.*dalvikvm\(\|32\|64\) E.*\] /d' "$4" > "$4.tmp" - -diff --strip-trailing-cr -q "$1" "$2" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4.tmp" >/dev/null +sed -i '/^.*dalvikvm\(\|32\|64\) E.*\] /d' "$4" diff --git a/test/1002-notify-startup/check b/test/1002-notify-startup/check index eadb5595a1..d284ede68c 100644..100755 --- a/test/1002-notify-startup/check +++ b/test/1002-notify-startup/check @@ -21,7 +21,4 @@ # $4: Test's actual standard error # Oat file manager will complain about duplicate dex files. Ignore. -sed -e '/.*oat_file_manager.*/d' "$4" > "$4.tmp" - -diff --strip-trailing-cr -q "$1" "$2" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4.tmp" >/dev/null +sed -i '/.*oat_file_manager.*/d' "$4" diff --git a/test/115-native-bridge/check b/test/115-native-bridge/check index e01de910b6..50edac14cc 100755 --- a/test/115-native-bridge/check +++ b/test/115-native-bridge/check @@ -22,6 +22,4 @@ # ASAN prints a warning here. -diff --strip-trailing-cr -q "$1" "$2" >/dev/null \ - && sed -e '/WARNING: ASan is ignoring requested __asan_handle_no_return/,+2d' "$4" \ - | diff --strip-trailing-cr -q "$3" - >/dev/null +sed -i '/WARNING: ASan is ignoring requested __asan_handle_no_return/,+2d' "$4" diff --git a/test/118-noimage-dex2oat/check b/test/118-noimage-dex2oat/check index 90ffdf8973..ec836b8112 100755 --- a/test/118-noimage-dex2oat/check +++ b/test/118-noimage-dex2oat/check @@ -21,7 +21,4 @@ # $4: Test's actual standard error # Strip the process pids and line numbers from exact error messages. -sed -e '/^dalvikvm.* E.*\] /d' "$4" > "$4.tmp" - -diff --strip-trailing-cr -q "$1" "$2" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4.tmp" >/dev/null +sed -i '/^dalvikvm.* E.*\] /d' "$4" diff --git a/test/1337-gc-coverage/check b/test/1337-gc-coverage/check index 67fcafbe6e..05e0ea3f87 100755 --- a/test/1337-gc-coverage/check +++ b/test/1337-gc-coverage/check @@ -20,6 +20,5 @@ # $3: Test's expected standard error # $4: Test's actual standard error -# Check that the string "error" isn't present -grep -vq error "$2" \ - && diff --strip-trailing-cr -q "$3" "$4" >/dev/null +# Check that the string "error" isn't present (delete all non-error lines) +sed -i '/error/!d' "$2" diff --git a/test/1339-dead-reference-safe/check b/test/1339-dead-reference-safe/check index e7f5f9693d..3e2b0c6ed1 100644..100755 --- a/test/1339-dead-reference-safe/check +++ b/test/1339-dead-reference-safe/check @@ -22,6 +22,4 @@ # DeadReferenceSafe result differs for interpreted mode. A real failure # will produce an extra line anyway. - -diff --ignore-matching-lines="DeadReferenceSafe count:" -q $1 $2 \ - && diff --strip-trailing-cr -q "$3" "$4" >/dev/null +sed -i -E 's/^(.*DeadReferenceSafe count: )[0-9]+(.*)$/\1N\2/' "$2" diff --git a/test/139-register-natives/check b/test/139-register-natives/check index f9b35f60ca..419df00813 100755 --- a/test/139-register-natives/check +++ b/test/139-register-natives/check @@ -21,7 +21,4 @@ # $4: Test's actual standard error # Strip any JNI registration error messages -sed -e '/jni_entrypoints/d' -e '/jni_internal.cc/d' "$4" > "$4.tmp" - -diff --strip-trailing-cr -q "$1" "$2" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4.tmp" >/dev/null +sed -i -E '/(jni_entrypoints|jni_internal.cc)/d' "$4" diff --git a/test/143-string-value/check b/test/143-string-value/check index 0691e88c3e..1c897162eb 100755 --- a/test/143-string-value/check +++ b/test/143-string-value/check @@ -21,7 +21,4 @@ # $4: Test's actual standard error # Strip error log messages. -sed -e '/^.*dalvikvm\(\|32\|64\) E.*\] /d' "$4" > "$4.tmp" - -diff --strip-trailing-cr -q "$1" "$2" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4.tmp" >/dev/null +sed -i '/^.*dalvikvm\(\|32\|64\) E.*\] /d' "$4" diff --git a/test/146-bad-interface/check b/test/146-bad-interface/check index eadb5595a1..d284ede68c 100644..100755 --- a/test/146-bad-interface/check +++ b/test/146-bad-interface/check @@ -21,7 +21,4 @@ # $4: Test's actual standard error # Oat file manager will complain about duplicate dex files. Ignore. -sed -e '/.*oat_file_manager.*/d' "$4" > "$4.tmp" - -diff --strip-trailing-cr -q "$1" "$2" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4.tmp" >/dev/null +sed -i '/.*oat_file_manager.*/d' "$4" diff --git a/test/148-multithread-gc-annotations/check b/test/148-multithread-gc-annotations/check index 67fcafbe6e..05e0ea3f87 100755 --- a/test/148-multithread-gc-annotations/check +++ b/test/148-multithread-gc-annotations/check @@ -20,6 +20,5 @@ # $3: Test's expected standard error # $4: Test's actual standard error -# Check that the string "error" isn't present -grep -vq error "$2" \ - && diff --strip-trailing-cr -q "$3" "$4" >/dev/null +# Check that the string "error" isn't present (delete all non-error lines) +sed -i '/error/!d' "$2" diff --git a/test/172-app-image-twice/check b/test/172-app-image-twice/check index 228bcb5c25..7c23c1bbc2 100755 --- a/test/172-app-image-twice/check +++ b/test/172-app-image-twice/check @@ -21,5 +21,4 @@ # $4: Test's actual standard error # Remove all lines not containing "passed". -grep "^passed" "$2" | diff --strip-trailing-cr -q "$1" - >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4" >/dev/null +sed -i '/^passed/!d' "$2" diff --git a/test/178-app-image-native-method/check b/test/178-app-image-native-method/check index 45d365470c..c6839807fe 100755 --- a/test/178-app-image-native-method/check +++ b/test/178-app-image-native-method/check @@ -21,5 +21,4 @@ # $4: Test's actual standard error # Filter out error messages for missing native methods. -diff --strip-trailing-cr -q "$1" "$2" >/dev/null \ - && grep -v 'No implementation found for ' "$4" | diff -q "$3" - >/dev/null +sed -i '/No implementation found for/d' "$4" diff --git a/test/1931-monitor-events/check b/test/1931-monitor-events/check index 3f799cc299..0e638a89ff 100644..100755 --- a/test/1931-monitor-events/check +++ b/test/1931-monitor-events/check @@ -24,5 +24,3 @@ if [[ "$TEST_RUNTIME" == "jvm" ]]; then patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null fi - -./default-check "$@" diff --git a/test/1932-monitor-events-misc/check b/test/1932-monitor-events-misc/check index 0fe44292b9..c70be4225b 100644..100755 --- a/test/1932-monitor-events-misc/check +++ b/test/1932-monitor-events-misc/check @@ -24,5 +24,3 @@ if [[ "$TEST_RUNTIME" == "jvm" ]]; then patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null fi - -./default-check "$@" diff --git a/test/1936-thread-end-events/check b/test/1936-thread-end-events/check index 0fe44292b9..c70be4225b 100644..100755 --- a/test/1936-thread-end-events/check +++ b/test/1936-thread-end-events/check @@ -24,5 +24,3 @@ if [[ "$TEST_RUNTIME" == "jvm" ]]; then patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null fi - -./default-check "$@" diff --git a/test/1950-unprepared-transform/check b/test/1950-unprepared-transform/check index 0fe44292b9..c70be4225b 100755 --- a/test/1950-unprepared-transform/check +++ b/test/1950-unprepared-transform/check @@ -24,5 +24,3 @@ if [[ "$TEST_RUNTIME" == "jvm" ]]; then patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null fi - -./default-check "$@" diff --git a/test/1953-pop-frame/check b/test/1953-pop-frame/check index 24bbf07e93..65e96ffe2c 100755 --- a/test/1953-pop-frame/check +++ b/test/1953-pop-frame/check @@ -23,5 +23,6 @@ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks. # See b/116003018. Some configurations cannot handle the class load events in # quite the right way so they are disabled there too. -./default-check "$@" || \ - (patch -p0 expected-stdout.txt < class-loading-expected.patch >/dev/null && ./default-check "$@") +if [[ "$TEST_RUNTIME" != "jvm" && "x$VERIFY_SOFT_FAIL" != "xtrue" ]]; then + patch -p0 expected-stdout.txt < class-loading-expected.patch +fi diff --git a/test/1954-pop-frame-jit/check b/test/1954-pop-frame-jit/check index e25838a3b2..d2d1843a08 100755 --- a/test/1954-pop-frame-jit/check +++ b/test/1954-pop-frame-jit/check @@ -23,5 +23,6 @@ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks. # See b/116003018. Some configurations cannot handle the class load events in # quite the right way so they are disabled there too. -./default-check "$@" || \ - (patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null && ./default-check "$@") +if [[ "$TEST_RUNTIME" == "jvm" || "x$VERIFY_SOFT_FAIL" == "xtrue" ]]; then + patch -p0 expected-stdout.txt < jvm-expected.patch +fi diff --git a/test/1955-pop-frame-jit-called/check b/test/1955-pop-frame-jit-called/check index e25838a3b2..d2d1843a08 100755 --- a/test/1955-pop-frame-jit-called/check +++ b/test/1955-pop-frame-jit-called/check @@ -23,5 +23,6 @@ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks. # See b/116003018. Some configurations cannot handle the class load events in # quite the right way so they are disabled there too. -./default-check "$@" || \ - (patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null && ./default-check "$@") +if [[ "$TEST_RUNTIME" == "jvm" || "x$VERIFY_SOFT_FAIL" == "xtrue" ]]; then + patch -p0 expected-stdout.txt < jvm-expected.patch +fi diff --git a/test/1956-pop-frame-jit-calling/check b/test/1956-pop-frame-jit-calling/check index e25838a3b2..d2d1843a08 100755 --- a/test/1956-pop-frame-jit-calling/check +++ b/test/1956-pop-frame-jit-calling/check @@ -23,5 +23,6 @@ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks. # See b/116003018. Some configurations cannot handle the class load events in # quite the right way so they are disabled there too. -./default-check "$@" || \ - (patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null && ./default-check "$@") +if [[ "$TEST_RUNTIME" == "jvm" || "x$VERIFY_SOFT_FAIL" == "xtrue" ]]; then + patch -p0 expected-stdout.txt < jvm-expected.patch +fi diff --git a/test/1963-add-to-dex-classloader-in-memory/check b/test/1963-add-to-dex-classloader-in-memory/check index d53689161c..df785dfb15 100755 --- a/test/1963-add-to-dex-classloader-in-memory/check +++ b/test/1963-add-to-dex-classloader-in-memory/check @@ -23,10 +23,6 @@ # Some of our test devices are so old that they don't have memfd_create and are setup in such a way # that tmpfile() doesn't work. In these cases this test cannot complete successfully. -if grep -q -- '---NO memfd_create---' $@; then - echo "The test device doesn't have memfd_create. Cannot verify test!" >&2 - exit 0 -fi - - -./default-check "$@" +# If we see this in stdout, make the expected stdout identical. +grep -q -- '---NO memfd_create---' "$2" && echo '---NO memfd_create---' > "$1" +exit 0 diff --git a/test/1969-force-early-return-void/check b/test/1969-force-early-return-void/check index 24bbf07e93..2e0de80df6 100755 --- a/test/1969-force-early-return-void/check +++ b/test/1969-force-early-return-void/check @@ -23,5 +23,6 @@ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks. # See b/116003018. Some configurations cannot handle the class load events in # quite the right way so they are disabled there too. -./default-check "$@" || \ - (patch -p0 expected-stdout.txt < class-loading-expected.patch >/dev/null && ./default-check "$@") +if [[ "$VERIFY_SOFT_FAIL" != "true" ]]; then + patch -p0 expected-stdout.txt < class-loading-expected.patch +fi diff --git a/test/2033-shutdown-mechanics/check b/test/2033-shutdown-mechanics/check index 9523159db5..08c3ffcec8 100755 --- a/test/2033-shutdown-mechanics/check +++ b/test/2033-shutdown-mechanics/check @@ -22,5 +22,4 @@ # The daemon thread seems to occasionally get stopped before finishing. # Check that the actual output is a line-by-line prefix of expected. -head -n $(wc -l < $2) $1 | diff --strip-trailing-cr -q - "$2" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4" >/dev/null +head -n $(wc -l < $2) $1 > $1.tmp && mv $1.tmp $1 diff --git a/test/2232-write-metrics-to-log/Android.bp b/test/2232-write-metrics-to-log/Android.bp index a64567e0f0..6a1e68c1fd 100644 --- a/test/2232-write-metrics-to-log/Android.bp +++ b/test/2232-write-metrics-to-log/Android.bp @@ -15,7 +15,7 @@ package { java_test { name: "art-run-test-2232-write-metrics-to-log", defaults: ["art-run-test-defaults"], - test_config_template: ":art-run-test-target-template", + test_config_template: ":art-run-test-target-no-test-suite-tag-template", srcs: ["src/**/*.java"], data: [ ":art-run-test-2232-write-metrics-to-log-expected-stdout", diff --git a/test/2232-write-metrics-to-log/check b/test/2232-write-metrics-to-log/check index d12e8b126d..31317ee2cd 100755 --- a/test/2232-write-metrics-to-log/check +++ b/test/2232-write-metrics-to-log/check @@ -21,14 +21,4 @@ # $4: Test's actual standard error # Check that one of the metrics appears in stderr. -grep 'ClassVerificationTotalTime' "$4" >/dev/null -MSG_FOUND=$? - -if [[ $MSG_FOUND -ne 0 ]] ; then - # Print out the log and return with error. - cat "$4" - exit 1 -fi - -# Success. -exit 0 +sed -i -n 's/.*\(ClassVerificationTotalTime\).*/\1/p' "$4" diff --git a/test/2232-write-metrics-to-log/expected-stderr.txt b/test/2232-write-metrics-to-log/expected-stderr.txt index e69de29bb2..9546999d34 100644 --- a/test/2232-write-metrics-to-log/expected-stderr.txt +++ b/test/2232-write-metrics-to-log/expected-stderr.txt @@ -0,0 +1 @@ +ClassVerificationTotalTime diff --git a/test/2239-varhandle-perf/check b/test/2239-varhandle-perf/check index 8ea102d53c..9593c52bf9 100644..100755 --- a/test/2239-varhandle-perf/check +++ b/test/2239-varhandle-perf/check @@ -16,6 +16,7 @@ # Dump the output of the benchmarks that run and report success. The # benchmarks ran successfully if we get as far as this script. - cat "$2" -exit 0 + +# Delete all output to make the diff unconditionally pass. +> "$2" diff --git a/test/656-annotation-lookup-generic-jni/check b/test/656-annotation-lookup-generic-jni/check index e02c84d452..3c7753d4d6 100755 --- a/test/656-annotation-lookup-generic-jni/check +++ b/test/656-annotation-lookup-generic-jni/check @@ -22,6 +22,4 @@ # On gcstress configurations, an extra "JNI_OnUnload called" line may # be emitted. If so, remove it. -sed -e '${/^JNI_OnUnload called$/d;}' "$2" > "$2.tmp" - -./default-check "$1" "$2.tmp" "$3" "$4" +sed -i '/^JNI_OnUnload called$/d' "$2" diff --git a/test/674-hiddenapi/check b/test/674-hiddenapi/check index c8afc229c2..353882c0ea 100644..100755 --- a/test/674-hiddenapi/check +++ b/test/674-hiddenapi/check @@ -20,11 +20,5 @@ # $3: Test's expected standard error # $4: Test's actual standard error -# Remove pid and date from the log messages. -grep -v JNI_OnLoad "$2" \ - | grep -v JNI_OnUnload \ - > "$2.tmp" -grep -vE '^dalvikvm(32|64) E [^]]+]' "$4" \ - > "$4.tmp" - -./default-check "$1" "$2.tmp" "$3" "$4.tmp" +sed -i -E '/(JNI_OnLoad|JNI_OnUnload)/d' "$2" +sed -i -E '/^dalvikvm(32|64) E [^]]+]/d' "$4" diff --git a/test/677-fsi/check b/test/677-fsi/check index 8c7f18b903..46bddf5ddb 100644..100755 --- a/test/677-fsi/check +++ b/test/677-fsi/check @@ -21,11 +21,8 @@ # $4: Test's actual standard error # Only keep the lines we're interested in. -sed -s '/Hello World/!d' "$2" > "$2.tmp" -sed -s '/^.*: oat file has dex code, but APK has uncompressed dex code/!d' "$4" > "$4.tmp" +sed -i '/Hello World/!d' "$2" +sed -i '/^.*: oat file has dex code, but APK has uncompressed dex code/!d' "$4" # Remove part of message containing filename. -sed -s 's/^.*: //' "$4.tmp" > "$4.tmp2" - -diff --strip-trailing-cr -q "$1" "$2.tmp" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4.tmp2" >/dev/null +sed -i 's/^.*: //' "$4" diff --git a/test/688-shared-library/check b/test/688-shared-library/check index 8501835c99..6d0f0775f8 100644..100755 --- a/test/688-shared-library/check +++ b/test/688-shared-library/check @@ -23,7 +23,4 @@ # Finalizers of DexFile will complain not being able to close # the main dex file, as it's still open. That's OK to ignore. # Oat file manager will also complain about duplicate dex files. Ignore. -sed -e '/^E\/System/d' "$4" | sed -e '/.*oat_file_manager.*/d' > "$4.tmp" - -diff --strip-trailing-cr -q "$1" "$2" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4.tmp" >/dev/null +sed -i -e '/^E\/System/d' -e '/.*oat_file_manager.*/d' "$4" diff --git a/test/707-checker-invalid-profile/check b/test/707-checker-invalid-profile/check index 58d3a52b6a..af64520533 100755 --- a/test/707-checker-invalid-profile/check +++ b/test/707-checker-invalid-profile/check @@ -24,5 +24,4 @@ # command strips out the error message. grep -v -f $1 $2 > $1 grep -v -f $3 $4 > $3 - -./default-check "$@" +exit 0 diff --git a/test/817-hiddenapi/check b/test/817-hiddenapi/check index 8c21ab4d56..3b6cc6ab34 100755 --- a/test/817-hiddenapi/check +++ b/test/817-hiddenapi/check @@ -22,6 +22,4 @@ # On gcstress configurations, an extra "JNI_OnUnload called" line may # be emitted. If so, remove it. -sed -e '${/^JNI_OnUnload called$/d;}' "$2" > "$2.tmp" - -./default-check "$1" "$2.tmp" "$3" "$4" +sed -i '/^JNI_OnUnload called$/d' "$2" diff --git a/test/954-invoke-polymorphic-verifier/check b/test/954-invoke-polymorphic-verifier/check index 3f9e6dcc48..557b1b6a20 100755 --- a/test/954-invoke-polymorphic-verifier/check +++ b/test/954-invoke-polymorphic-verifier/check @@ -21,6 +21,4 @@ # $4: Test's actual standard error # Strip out temporary file path information and indices from output. -sed -e "s/ [(]declaration of.*//" -e "s/\[0x[0-9A-F]*\] //g" "$2" > "$2.tmp" -diff --strip-trailing-cr -q "$1" "$2.tmp" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4" >/dev/null +sed -i -e 's/ [(]declaration of.*//' -e 's/\[0x[0-9A-F]*\] //g' "$2" diff --git a/test/980-redefine-object/check b/test/980-redefine-object/check index 80a3cd78a6..4ea7c5e398 100755 --- a/test/980-redefine-object/check +++ b/test/980-redefine-object/check @@ -23,8 +23,4 @@ # The number of paused background threads (and therefore InterruptedExceptions) # can change so we will just delete their lines from the log. -cat "$2" \ - | sed "/Object allocated of type 'java\.lang\.InterruptedException'/d" \ - | sed "/Object allocated of type 'java\.lang\.Long'/d" \ - | diff --strip-trailing-cr -q "$1" - >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4" >/dev/null +sed -i -E "/Object allocated of type 'java\.lang\.(InterruptedException|Long)'/d" "$2" diff --git a/test/Android.bp b/test/Android.bp index 4b466d43cd..813517b3d7 100644 --- a/test/Android.bp +++ b/test/Android.bp @@ -1888,7 +1888,6 @@ genrule_defaults { tool_files: [ "art_build_rules.py", "run-test-build.py", - "etc/default-check", "etc/default-run", "etc/run-test-jar", ":art-run-test-bootclasspath", diff --git a/test/etc/default-check b/test/etc/default-check deleted file mode 100755 index f6f7bf4094..0000000000 --- a/test/etc/default-check +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2014 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Inputs: -# $1: Test's expected standard output -# $2: Test's actual standard output -# $3: Test's expected standard error -# $4: Test's actual standard error - -diff --strip-trailing-cr -q "$1" "$2" >/dev/null \ - && diff --strip-trailing-cr -q "$3" "$4" >/dev/null diff --git a/test/run-test b/test/run-test index cf859f098e..f5820fad29 100755 --- a/test/run-test +++ b/test/run-test @@ -329,6 +329,7 @@ if True: shift() elif arg == "--verify-soft-fail": run_args += ["--verify-soft-fail"] + os.environ["VERIFY_SOFT_FAIL"] = "true" shift() elif arg == "--no-optimize": run_args += ["--no-optimize"] @@ -949,9 +950,13 @@ if True: good_run = "yes" else: good_run = "yes" + if os.path.exists(check_cmd): + run(f'./{check_cmd} "{expected_stdout}" "{test_stdout}" "{expected_stderr}" "{test_stderr}"') proc = run( - f'./{check_cmd} "{expected_stdout}" "{test_stdout}" "{expected_stderr}" "{test_stderr}"', - check=False) + f'diff --strip-trailing-cr -u "{expected_stdout}" "{test_stdout}" &&' + f'diff --strip-trailing-cr -u "{expected_stderr}" "{test_stderr}"', + check=False # Don't crash on non-zero exit code. + ) if proc.returncode == 0: if good_run == "yes": # test_stdout == expected_stdout && test_stderr == expected_stderr diff --git a/test/run-test-build.py b/test/run-test-build.py index 1436d3d0e7..aa2cde1767 100755 --- a/test/run-test-build.py +++ b/test/run-test-build.py @@ -50,7 +50,7 @@ def copy_sources(args, tmp, mode, srcdir): shutil.copytree(srcdir, dstdir) # Copy the default scripts if the test does not have a custom ones. - for name in ["run", "check"]: + for name in ["run"]: src, dst = f"art/test/etc/default-{name}", join(dstdir, name) if os.path.exists(dst): shutil.copy2(src, dstdir) # Copy default script next to the custom script. diff --git a/test/utils/regen-test-files b/test/utils/regen-test-files index 40d57dad38..82aca3da69 100755 --- a/test/utils/regen-test-files +++ b/test/utils/regen-test-files @@ -101,7 +101,6 @@ runnable_test_exceptions = frozenset([ "165-lock-owner-proxy", "168-vmstack-annotated", "176-app-image-string", - "2232-write-metrics-to-log", "304-method-tracing", "628-vdex", "643-checker-bogus-ic", |