Fix run-test check for --jvmti-redefine-stress
Adjust the patch condition for jvmti-redefine-stress as well.
Invert the patch for some tests to make them consistent.
Test: ./art/test.py -r --all-target --optimizing --all-jvmti \
-t 1953 -t 1954 -t 1955 -t 1956 -t 1969
Change-Id: Ib8519885e3603a15542e3c31f0df90f373deb4a3
diff --git a/test/1953-pop-frame/check b/test/1953-pop-frame/check
index 65e96ff..a3b6fa6 100755
--- a/test/1953-pop-frame/check
+++ b/test/1953-pop-frame/check
@@ -23,6 +23,8 @@
# 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.
-if [[ "$TEST_RUNTIME" != "jvm" && "x$VERIFY_SOFT_FAIL" != "xtrue" ]]; then
- patch -p0 expected-stdout.txt < class-loading-expected.patch
+if [[ "$TEST_RUNTIME" == "jvm" || \
+ "$VERIFY_SOFT_FAIL" == "true" || \
+ ("$JVMTI_REDEFINE_STRESS" == "true" && "$RUN_MODE" == "host") ]]; then
+ patch -p0 expected-stdout.txt < jvm-expected.patch
fi
diff --git a/test/1953-pop-frame/class-loading-expected.patch b/test/1953-pop-frame/class-loading-expected.patch
deleted file mode 100644
index 1a5eda7..0000000
--- a/test/1953-pop-frame/class-loading-expected.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-36a37,50
-> Test stopped during notifyFramePop without exception on pop of calledFunction
-> Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
-> result is StandardTestObject { cnt: 2 } base-call count: 1
-> Test stopped during notifyFramePop without exception on pop of doNothing
-> Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
-> result is StandardTestObject { cnt: 1 } base-call count: 1
-> Test stopped during notifyFramePop with exception on pop of calledFunction
-> Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0
-> art.Test1953$ExceptionThrowTestObject$TestError thrown and caught!
-> result is ExceptionThrowTestObject { cnt: 2 } base-call count: 1
-> Test stopped during notifyFramePop with exception on pop of doThrow
-> Single call with PopFrame on ExceptionCatchTestObject { cnt: 0 } base-call-count: 0
-> art.Test1953$ExceptionCatchTestObject$TestError caught in called function.
-> result is ExceptionCatchTestObject { cnt: 1 } base-call count: 1
-60a75,94
-> Test stopped during a ClassLoad event.
-> Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 0} base-call-count: 0
-> Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
-> art.Test1953.popFrame(Native Method)
-> art.Test1953.runTestOn(Test1953.java)
-> art.Test1953.runTestOn(Test1953.java)
-> art.Test1953.runTests(Test1953.java)
-> <Additional frames hidden>
-> TC0.foo == 1
-> result is ClassLoadObject { cnt: 1, curClass: 1} base-call count: 1
-> Test stopped during a ClassPrepare event.
-> Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 1} base-call-count: 0
-> Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
-> art.Test1953.popFrame(Native Method)
-> art.Test1953.runTestOn(Test1953.java)
-> art.Test1953.runTestOn(Test1953.java)
-> art.Test1953.runTests(Test1953.java)
-> <Additional frames hidden>
-> TC1.foo == 2
-> result is ClassLoadObject { cnt: 1, curClass: 2} base-call count: 1
diff --git a/test/1953-pop-frame/expected-stdout.txt b/test/1953-pop-frame/expected-stdout.txt
index dafc6b4..e75ea64 100644
--- a/test/1953-pop-frame/expected-stdout.txt
+++ b/test/1953-pop-frame/expected-stdout.txt
@@ -34,6 +34,20 @@
Test stopped during Method Exit due to exception thrown in subroutine
Single call with PopFrame on ExceptionOnceObject { cnt: 0, throwInSub: true } base-call-count: 0
result is ExceptionOnceObject { cnt: 2, throwInSub: true } base-call count: 1
+Test stopped during notifyFramePop without exception on pop of calledFunction
+Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+result is StandardTestObject { cnt: 2 } base-call count: 1
+Test stopped during notifyFramePop without exception on pop of doNothing
+Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+result is StandardTestObject { cnt: 1 } base-call count: 1
+Test stopped during notifyFramePop with exception on pop of calledFunction
+Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0
+art.Test1953$ExceptionThrowTestObject$TestError thrown and caught!
+result is ExceptionThrowTestObject { cnt: 2 } base-call count: 1
+Test stopped during notifyFramePop with exception on pop of doThrow
+Single call with PopFrame on ExceptionCatchTestObject { cnt: 0 } base-call-count: 0
+art.Test1953$ExceptionCatchTestObject$TestError caught in called function.
+result is ExceptionCatchTestObject { cnt: 1 } base-call count: 1
Test stopped during ExceptionCatch event of calledFunction (catch in called function, throw in called function)
Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0
art.Test1953$ExceptionThrowTestObject$TestError caught in same function.
@@ -58,6 +72,26 @@
Single call with PopFrame on ExceptionThrowFarTestObject { cnt: 0 } base-call-count: 0
art.Test1953$ExceptionThrowFarTestObject$TestError caught in same function.
result is ExceptionThrowFarTestObject { cnt: 2 } base-call count: 1
+Test stopped during a ClassLoad event.
+Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 0} base-call-count: 0
+Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
+ art.Test1953.popFrame(Native Method)
+ art.Test1953.runTestOn(Test1953.java)
+ art.Test1953.runTestOn(Test1953.java)
+ art.Test1953.runTests(Test1953.java)
+ <Additional frames hidden>
+TC0.foo == 1
+result is ClassLoadObject { cnt: 1, curClass: 1} base-call count: 1
+Test stopped during a ClassPrepare event.
+Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 1} base-call-count: 0
+Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
+ art.Test1953.popFrame(Native Method)
+ art.Test1953.runTestOn(Test1953.java)
+ art.Test1953.runTestOn(Test1953.java)
+ art.Test1953.runTests(Test1953.java)
+ <Additional frames hidden>
+TC1.foo == 2
+result is ClassLoadObject { cnt: 1, curClass: 2} base-call count: 1
Test stopped during random Suspend.
Single call with PopFrame on SuspendSuddenlyObject { cnt: 0 } base-call-count: 0
result is SuspendSuddenlyObject { cnt: 2 } base-call count: 1
diff --git a/test/1953-pop-frame/jvm-expected.patch b/test/1953-pop-frame/jvm-expected.patch
new file mode 100644
index 0000000..6539d56
--- /dev/null
+++ b/test/1953-pop-frame/jvm-expected.patch
@@ -0,0 +1,36 @@
+37,50d36
+< Test stopped during notifyFramePop without exception on pop of calledFunction
+< Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+< result is StandardTestObject { cnt: 2 } base-call count: 1
+< Test stopped during notifyFramePop without exception on pop of doNothing
+< Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+< result is StandardTestObject { cnt: 1 } base-call count: 1
+< Test stopped during notifyFramePop with exception on pop of calledFunction
+< Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0
+< art.Test1953$ExceptionThrowTestObject$TestError thrown and caught!
+< result is ExceptionThrowTestObject { cnt: 2 } base-call count: 1
+< Test stopped during notifyFramePop with exception on pop of doThrow
+< Single call with PopFrame on ExceptionCatchTestObject { cnt: 0 } base-call-count: 0
+< art.Test1953$ExceptionCatchTestObject$TestError caught in called function.
+< result is ExceptionCatchTestObject { cnt: 1 } base-call count: 1
+75,94d60
+< Test stopped during a ClassLoad event.
+< Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 0} base-call-count: 0
+< Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
+< art.Test1953.popFrame(Native Method)
+< art.Test1953.runTestOn(Test1953.java)
+< art.Test1953.runTestOn(Test1953.java)
+< art.Test1953.runTests(Test1953.java)
+< <Additional frames hidden>
+< TC0.foo == 1
+< result is ClassLoadObject { cnt: 1, curClass: 1} base-call count: 1
+< Test stopped during a ClassPrepare event.
+< Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 1} base-call-count: 0
+< Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
+< art.Test1953.popFrame(Native Method)
+< art.Test1953.runTestOn(Test1953.java)
+< art.Test1953.runTestOn(Test1953.java)
+< art.Test1953.runTests(Test1953.java)
+< <Additional frames hidden>
+< TC1.foo == 2
+< result is ClassLoadObject { cnt: 1, curClass: 2} base-call count: 1
diff --git a/test/1954-pop-frame-jit/check b/test/1954-pop-frame-jit/check
index d2d1843..a3b6fa6 100755
--- a/test/1954-pop-frame-jit/check
+++ b/test/1954-pop-frame-jit/check
@@ -23,6 +23,8 @@
# 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.
-if [[ "$TEST_RUNTIME" == "jvm" || "x$VERIFY_SOFT_FAIL" == "xtrue" ]]; then
+if [[ "$TEST_RUNTIME" == "jvm" || \
+ "$VERIFY_SOFT_FAIL" == "true" || \
+ ("$JVMTI_REDEFINE_STRESS" == "true" && "$RUN_MODE" == "host") ]]; 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 d2d1843..a3b6fa6 100755
--- a/test/1955-pop-frame-jit-called/check
+++ b/test/1955-pop-frame-jit-called/check
@@ -23,6 +23,8 @@
# 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.
-if [[ "$TEST_RUNTIME" == "jvm" || "x$VERIFY_SOFT_FAIL" == "xtrue" ]]; then
+if [[ "$TEST_RUNTIME" == "jvm" || \
+ "$VERIFY_SOFT_FAIL" == "true" || \
+ ("$JVMTI_REDEFINE_STRESS" == "true" && "$RUN_MODE" == "host") ]]; 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 d2d1843..a3b6fa6 100755
--- a/test/1956-pop-frame-jit-calling/check
+++ b/test/1956-pop-frame-jit-calling/check
@@ -23,6 +23,8 @@
# 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.
-if [[ "$TEST_RUNTIME" == "jvm" || "x$VERIFY_SOFT_FAIL" == "xtrue" ]]; then
+if [[ "$TEST_RUNTIME" == "jvm" || \
+ "$VERIFY_SOFT_FAIL" == "true" || \
+ ("$JVMTI_REDEFINE_STRESS" == "true" && "$RUN_MODE" == "host") ]]; then
patch -p0 expected-stdout.txt < jvm-expected.patch
fi
diff --git a/test/1969-force-early-return-void/check b/test/1969-force-early-return-void/check
index 2e0de80..0619e49 100755
--- a/test/1969-force-early-return-void/check
+++ b/test/1969-force-early-return-void/check
@@ -23,6 +23,7 @@
# 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.
-if [[ "$VERIFY_SOFT_FAIL" != "true" ]]; then
- patch -p0 expected-stdout.txt < class-loading-expected.patch
+if [[ "$VERIFY_SOFT_FAIL" == "true" || \
+ ("$JVMTI_REDEFINE_STRESS" == "true" && "$RUN_MODE" == "host") ]]; then
+ patch -p0 expected-stdout.txt < jvm-expected.patch
fi
diff --git a/test/1969-force-early-return-void/class-loading-expected.patch b/test/1969-force-early-return-void/class-loading-expected.patch
deleted file mode 100644
index 5e13595..0000000
--- a/test/1969-force-early-return-void/class-loading-expected.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-178a179,212
-> Test stopped during class-load.
-> NORMAL RUN: Single call with no interference on (ID: 46) ClassLoadObject { cnt: 0, curClass: 0}
-> TC0.foo == 100
-> NORMAL RUN: result for (ID: 46) ClassLoadObject { cnt: 1, curClass: 1} on Test1969 target thread - 46
-> Single call with force-early-return on (ID: 47) ClassLoadObject { cnt: 0, curClass: 1}
-> Will force return of Test1969 target thread - 47
-> Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
-> art.NonStandardExit.forceEarlyReturnVoid(Native Method)
-> art.Test1969$TestSuspender.performForceReturn(Test1969.java)
-> art.Test1969.runTestOn(Test1969.java)
-> art.Test1969.runTestOn(Test1969.java)
-> art.Test1969.runTestOn(Test1969.java)
-> art.Test1969.runTests(Test1969.java)
-> <Additional frames hidden>
->
-> TC1.foo == 201
-> result for (ID: 47) ClassLoadObject { cnt: 1, curClass: 2} on Test1969 target thread - 47
-> Test stopped during class-load.
-> NORMAL RUN: Single call with no interference on (ID: 48) ClassLoadObject { cnt: 0, curClass: 2}
-> TC2.foo == 302
-> NORMAL RUN: result for (ID: 48) ClassLoadObject { cnt: 1, curClass: 3} on Test1969 target thread - 48
-> Single call with force-early-return on (ID: 49) ClassLoadObject { cnt: 0, curClass: 3}
-> Will force return of Test1969 target thread - 49
-> Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
-> art.NonStandardExit.forceEarlyReturnVoid(Native Method)
-> art.Test1969$TestSuspender.performForceReturn(Test1969.java)
-> art.Test1969.runTestOn(Test1969.java)
-> art.Test1969.runTestOn(Test1969.java)
-> art.Test1969.runTestOn(Test1969.java)
-> art.Test1969.runTests(Test1969.java)
-> <Additional frames hidden>
->
-> TC3.foo == 403
-> result for (ID: 49) ClassLoadObject { cnt: 1, curClass: 4} on Test1969 target thread - 49
diff --git a/test/1969-force-early-return-void/expected-stdout.txt b/test/1969-force-early-return-void/expected-stdout.txt
index fc685b4..1bb3252 100644
--- a/test/1969-force-early-return-void/expected-stdout.txt
+++ b/test/1969-force-early-return-void/expected-stdout.txt
@@ -176,3 +176,37 @@
Single call with force-early-return on (ID: 45) ObjectInitTestObject { cnt: 0 }
Will force return of Test1969 target thread - 45
result for (ID: 45) ObjectInitTestObject { cnt: 1 } on Test1969 target thread - 45
+Test stopped during class-load.
+NORMAL RUN: Single call with no interference on (ID: 46) ClassLoadObject { cnt: 0, curClass: 0}
+TC0.foo == 100
+NORMAL RUN: result for (ID: 46) ClassLoadObject { cnt: 1, curClass: 1} on Test1969 target thread - 46
+Single call with force-early-return on (ID: 47) ClassLoadObject { cnt: 0, curClass: 1}
+Will force return of Test1969 target thread - 47
+Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
+ art.NonStandardExit.forceEarlyReturnVoid(Native Method)
+ art.Test1969$TestSuspender.performForceReturn(Test1969.java)
+ art.Test1969.runTestOn(Test1969.java)
+ art.Test1969.runTestOn(Test1969.java)
+ art.Test1969.runTestOn(Test1969.java)
+ art.Test1969.runTests(Test1969.java)
+ <Additional frames hidden>
+
+TC1.foo == 201
+result for (ID: 47) ClassLoadObject { cnt: 1, curClass: 2} on Test1969 target thread - 47
+Test stopped during class-load.
+NORMAL RUN: Single call with no interference on (ID: 48) ClassLoadObject { cnt: 0, curClass: 2}
+TC2.foo == 302
+NORMAL RUN: result for (ID: 48) ClassLoadObject { cnt: 1, curClass: 3} on Test1969 target thread - 48
+Single call with force-early-return on (ID: 49) ClassLoadObject { cnt: 0, curClass: 3}
+Will force return of Test1969 target thread - 49
+Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
+ art.NonStandardExit.forceEarlyReturnVoid(Native Method)
+ art.Test1969$TestSuspender.performForceReturn(Test1969.java)
+ art.Test1969.runTestOn(Test1969.java)
+ art.Test1969.runTestOn(Test1969.java)
+ art.Test1969.runTestOn(Test1969.java)
+ art.Test1969.runTests(Test1969.java)
+ <Additional frames hidden>
+
+TC3.foo == 403
+result for (ID: 49) ClassLoadObject { cnt: 1, curClass: 4} on Test1969 target thread - 49
diff --git a/test/1969-force-early-return-void/jvm-expected.patch b/test/1969-force-early-return-void/jvm-expected.patch
new file mode 100644
index 0000000..d018239
--- /dev/null
+++ b/test/1969-force-early-return-void/jvm-expected.patch
@@ -0,0 +1,35 @@
+179,212d178
+< Test stopped during class-load.
+< NORMAL RUN: Single call with no interference on (ID: 46) ClassLoadObject { cnt: 0, curClass: 0}
+< TC0.foo == 100
+< NORMAL RUN: result for (ID: 46) ClassLoadObject { cnt: 1, curClass: 1} on Test1969 target thread - 46
+< Single call with force-early-return on (ID: 47) ClassLoadObject { cnt: 0, curClass: 1}
+< Will force return of Test1969 target thread - 47
+< Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
+< art.NonStandardExit.forceEarlyReturnVoid(Native Method)
+< art.Test1969$TestSuspender.performForceReturn(Test1969.java)
+< art.Test1969.runTestOn(Test1969.java)
+< art.Test1969.runTestOn(Test1969.java)
+< art.Test1969.runTestOn(Test1969.java)
+< art.Test1969.runTests(Test1969.java)
+< <Additional frames hidden>
+<
+< TC1.foo == 201
+< result for (ID: 47) ClassLoadObject { cnt: 1, curClass: 2} on Test1969 target thread - 47
+< Test stopped during class-load.
+< NORMAL RUN: Single call with no interference on (ID: 48) ClassLoadObject { cnt: 0, curClass: 2}
+< TC2.foo == 302
+< NORMAL RUN: result for (ID: 48) ClassLoadObject { cnt: 1, curClass: 3} on Test1969 target thread - 48
+< Single call with force-early-return on (ID: 49) ClassLoadObject { cnt: 0, curClass: 3}
+< Will force return of Test1969 target thread - 49
+< Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
+< art.NonStandardExit.forceEarlyReturnVoid(Native Method)
+< art.Test1969$TestSuspender.performForceReturn(Test1969.java)
+< art.Test1969.runTestOn(Test1969.java)
+< art.Test1969.runTestOn(Test1969.java)
+< art.Test1969.runTestOn(Test1969.java)
+< art.Test1969.runTests(Test1969.java)
+< <Additional frames hidden>
+<
+< TC3.foo == 403
+< result for (ID: 49) ClassLoadObject { cnt: 1, curClass: 4} on Test1969 target thread - 49
diff --git a/test/run-test b/test/run-test
index f5820fa..31ab76e 100755
--- a/test/run-test
+++ b/test/run-test
@@ -154,6 +154,7 @@
target_mode = "no"
DEX_LOCATION = tmp_dir
run_args += ["--host"]
+ os.environ["RUN_MODE"] = "host"
shift()
elif arg == "--quiet":
quiet = "yes"
@@ -222,15 +223,19 @@
shift()
elif arg == "--jvmti-step-stress":
jvmti_step_stress = "true"
+ os.environ["JVMTI_STEP_STRESS"] = "true"
shift()
elif arg == "--jvmti-redefine-stress":
jvmti_redefine_stress = "true"
+ os.environ["JVMTI_REDEFINE_STRESS"] = "true"
shift()
elif arg == "--jvmti-field-stress":
jvmti_field_stress = "true"
+ os.environ["JVMTI_FIELD_STRESS"] = "true"
shift()
elif arg == "--jvmti-trace-stress":
jvmti_trace_stress = "true"
+ os.environ["JVMTI_TRACE_STRESS"] = "true"
shift()
elif arg == "--suspend-timeout":
shift()