diff options
| -rw-r--r-- | test/030-bad-finalizer/expected.txt | 1 | ||||
| -rwxr-xr-x | test/030-bad-finalizer/run | 19 | ||||
| -rw-r--r-- | test/034-call-null/expected.txt | 1 | ||||
| -rwxr-xr-x | test/034-call-null/run | 19 | ||||
| -rw-r--r-- | test/038-inner-null/expected.txt | 1 | ||||
| -rwxr-xr-x | test/038-inner-null/run | 19 | ||||
| -rw-r--r-- | test/054-uncaught/expected.txt | 1 | ||||
| -rwxr-xr-x | test/054-uncaught/run | 19 | ||||
| -rw-r--r-- | test/714-invoke-custom-lambda-metafactory/expected.txt | 1 | ||||
| -rwxr-xr-x | test/714-invoke-custom-lambda-metafactory/run | 19 | ||||
| -rwxr-xr-x | test/etc/run-test-jar | 8 |
11 files changed, 107 insertions, 1 deletions
diff --git a/test/030-bad-finalizer/expected.txt b/test/030-bad-finalizer/expected.txt index 74e208c3f9..0aca6f2e93 100644 --- a/test/030-bad-finalizer/expected.txt +++ b/test/030-bad-finalizer/expected.txt @@ -2,3 +2,4 @@ About to null reference. Finalizer started and spinning... Finalizer done spinning. Finalizer sleeping forever now. +exit status: 2 diff --git a/test/030-bad-finalizer/run b/test/030-bad-finalizer/run new file mode 100755 index 0000000000..7a0d0d05ab --- /dev/null +++ b/test/030-bad-finalizer/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 2017 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. + +# Squash the exit status and put it in expected +./default-run "$@" +echo "exit status:" $? diff --git a/test/034-call-null/expected.txt b/test/034-call-null/expected.txt index 4e0281e556..11aefde417 100644 --- a/test/034-call-null/expected.txt +++ b/test/034-call-null/expected.txt @@ -1,2 +1,3 @@ Exception in thread "main" java.lang.NullPointerException: Attempt to invoke direct method 'void Main.doStuff(int, int[][], java.lang.String, java.lang.String[][])' on a null object reference at Main.main(Main.java:26) +exit status: 1 diff --git a/test/034-call-null/run b/test/034-call-null/run new file mode 100755 index 0000000000..7a0d0d05ab --- /dev/null +++ b/test/034-call-null/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 2017 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. + +# Squash the exit status and put it in expected +./default-run "$@" +echo "exit status:" $? diff --git a/test/038-inner-null/expected.txt b/test/038-inner-null/expected.txt index 2e925644e3..d148eff407 100644 --- a/test/038-inner-null/expected.txt +++ b/test/038-inner-null/expected.txt @@ -2,3 +2,4 @@ new Special() Exception in thread "main" java.lang.NullPointerException: Attempt to invoke virtual method 'void Main$Blort.repaint()' on a null object reference at Main$Special.callInner(Main.java:31) at Main.main(Main.java:20) +exit status: 1 diff --git a/test/038-inner-null/run b/test/038-inner-null/run new file mode 100755 index 0000000000..7a0d0d05ab --- /dev/null +++ b/test/038-inner-null/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 2017 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. + +# Squash the exit status and put it in expected +./default-run "$@" +echo "exit status:" $? diff --git a/test/054-uncaught/expected.txt b/test/054-uncaught/expected.txt index 7d7f03c3a7..878260a07d 100644 --- a/test/054-uncaught/expected.txt +++ b/test/054-uncaught/expected.txt @@ -18,3 +18,4 @@ Uncaught exception DEFAULT! java.lang.NullPointerException: Hi diddly-ho, neighborino. at Main.catchTheUncaught(Main.java:63) at Main.main(Main.java:26) +exit status: 1 diff --git a/test/054-uncaught/run b/test/054-uncaught/run new file mode 100755 index 0000000000..7a0d0d05ab --- /dev/null +++ b/test/054-uncaught/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 2017 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. + +# Squash the exit status and put it in expected +./default-run "$@" +echo "exit status:" $? diff --git a/test/714-invoke-custom-lambda-metafactory/expected.txt b/test/714-invoke-custom-lambda-metafactory/expected.txt index cbe98404c5..54b6c24798 100644 --- a/test/714-invoke-custom-lambda-metafactory/expected.txt +++ b/test/714-invoke-custom-lambda-metafactory/expected.txt @@ -2,3 +2,4 @@ Exception in thread "main" java.lang.BootstrapMethodError: Exception from call s at Main.main(Main.java:25) Caused by: java.lang.NullPointerException: Bootstrap method returned null ... 1 more +exit status: 1 diff --git a/test/714-invoke-custom-lambda-metafactory/run b/test/714-invoke-custom-lambda-metafactory/run new file mode 100755 index 0000000000..7a0d0d05ab --- /dev/null +++ b/test/714-invoke-custom-lambda-metafactory/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 2017 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. + +# Squash the exit status and put it in expected +./default-run "$@" +echo "exit status:" $? diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index 055cffbbb4..59c902264a 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -886,11 +886,14 @@ if [ "$HOST" = "n" ]; then adb push $cmdfile $DEX_LOCATION/cmdline.sh > /dev/null 2>&1 fi + exit_status=0 if [ "$DRY_RUN" != "y" ]; then adb shell sh $DEX_LOCATION/cmdline.sh + exit_status=$? fi rm -f $cmdfile + exit $exit_status else # Host run. export ANDROID_PRINTF_LOG=brief @@ -996,10 +999,12 @@ else trap 'kill -INT -$pid' INT $cmdline "$@" 2>&1 & pid=$! wait $pid + exit_value=$? # Add extra detail if time out is enabled. - if [ ${PIPESTATUS[0]} = 124 ] && [ "$TIME_OUT" = "timeout" ]; then + if [ $exit_value = 124 ] && [ "$TIME_OUT" = "timeout" ]; then echo -e "\e[91mTEST TIMED OUT!\e[0m" >&2 fi + exit $exit_value else # With a thread dump that uses gdb if a timeout. trap 'kill -INT -$pid' INT @@ -1022,6 +1027,7 @@ else # The test timed out. echo -e "\e[91mTEST TIMED OUT!\e[0m" >&2 fi + exit $test_exit_status fi fi fi |