Revert "Ensure that run-test preserves exit status"

Fails:
test-art-host-run-test-debug-no-prebuild-interp-ac-no-relocate-ntrace-cms-checkjni-picimage-npictest-ndebuggable-no-jvmti-cdex-fast-134-nodex2oat-nofallback32 


This reverts commit 1fbd5309858e5f70b5adaa1d70b9e438eaf18d33.

Change-Id: I29809f7bb26e4a9d81634bcf24d9ce151a41a583
diff --git a/test/030-bad-finalizer/expected.txt b/test/030-bad-finalizer/expected.txt
index 0aca6f2..74e208c 100644
--- a/test/030-bad-finalizer/expected.txt
+++ b/test/030-bad-finalizer/expected.txt
@@ -2,4 +2,3 @@
 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
deleted file mode 100755
index 7a0d0d0..0000000
--- a/test/030-bad-finalizer/run
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/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 11aefde..4e0281e 100644
--- a/test/034-call-null/expected.txt
+++ b/test/034-call-null/expected.txt
@@ -1,3 +1,2 @@
 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
deleted file mode 100755
index 7a0d0d0..0000000
--- a/test/034-call-null/run
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/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 d148eff..2e92564 100644
--- a/test/038-inner-null/expected.txt
+++ b/test/038-inner-null/expected.txt
@@ -2,4 +2,3 @@
 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
deleted file mode 100755
index 7a0d0d0..0000000
--- a/test/038-inner-null/run
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/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 878260a..7d7f03c 100644
--- a/test/054-uncaught/expected.txt
+++ b/test/054-uncaught/expected.txt
@@ -18,4 +18,3 @@
 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
deleted file mode 100755
index 7a0d0d0..0000000
--- a/test/054-uncaught/run
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/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 54b6c24..cbe9840 100644
--- a/test/714-invoke-custom-lambda-metafactory/expected.txt
+++ b/test/714-invoke-custom-lambda-metafactory/expected.txt
@@ -2,4 +2,3 @@
 	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
deleted file mode 100755
index 7a0d0d0..0000000
--- a/test/714-invoke-custom-lambda-metafactory/run
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/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 59c9022..055cffb 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -886,14 +886,11 @@
       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
@@ -999,12 +996,10 @@
         trap 'kill -INT -$pid' INT
         $cmdline "$@" 2>&1 & pid=$!
         wait $pid
-        exit_value=$?
         # Add extra detail if time out is enabled.
-        if [ $exit_value = 124 ] && [ "$TIME_OUT" = "timeout" ]; then
+        if [ ${PIPESTATUS[0]} = 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
@@ -1027,7 +1022,6 @@
             # The test timed out.
             echo -e "\e[91mTEST TIMED OUT!\e[0m" >&2
           fi
-          exit $test_exit_status
         fi
       fi
     fi