Handle error logs now being printed in a new format.

Instead of removing them from the expected output, set the log level to
fatal for the tests that expect error messages.

Bug: 148179431
Test: test.py
Change-Id: Ib602d0435a2d0cd3d14b9c5d06e969d48082889e
diff --git a/test/030-bad-finalizer/run b/test/030-bad-finalizer/run
index 7a0d0d0..54747ee 100755
--- a/test/030-bad-finalizer/run
+++ b/test/030-bad-finalizer/run
@@ -14,6 +14,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# The test logs error messages which is expected, discard them.
+export ANDROID_LOG_TAGS='*:f'
+
 # Squash the exit status and put it in expected
-./default-run "$@"
+./default-run --external-log-tags "${@}"
 echo "exit status:" $?
diff --git a/test/059-finalizer-throw/check b/test/059-finalizer-throw/check
deleted file mode 100755
index 8bc59c6..0000000
--- a/test/059-finalizer-throw/check
+++ /dev/null
@@ -1,20 +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.
-
-# Strip uncaught exception logging. These are "E/System" messages.
-sed -e '/^E\/System/d' "$2" > "$2.tmp"
-
-diff --strip-trailing-cr -q "$1" "$2.tmp" >/dev/null
diff --git a/test/030-bad-finalizer/check b/test/059-finalizer-throw/run
old mode 100755
new mode 100644
similarity index 72%
rename from test/030-bad-finalizer/check
rename to test/059-finalizer-throw/run
index e5d5c4e..dda4159
--- a/test/030-bad-finalizer/check
+++ b/test/059-finalizer-throw/run
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright (C) 2014 The Android Open Source Project
+# Copyright (C) 2020 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.
@@ -14,7 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Strip timeout logging. These are "E/System" messages.
-sed -e '/^E\/System/d' "$2" > "$2.tmp"
-
-diff --strip-trailing-cr -q "$1" "$2.tmp" >/dev/null
+# The test logs error messages which is expected, discard them.
+export ANDROID_LOG_TAGS='*:f'
+exec ${RUN} --external-log-tags "${@}"
diff --git a/test/1336-short-finalizer-timeout/check b/test/1336-short-finalizer-timeout/check
deleted file mode 100755
index e5d5c4e..0000000
--- a/test/1336-short-finalizer-timeout/check
+++ /dev/null
@@ -1,20 +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.
-
-# Strip timeout logging. These are "E/System" messages.
-sed -e '/^E\/System/d' "$2" > "$2.tmp"
-
-diff --strip-trailing-cr -q "$1" "$2.tmp" >/dev/null
diff --git a/test/1336-short-finalizer-timeout/run b/test/1336-short-finalizer-timeout/run
index 3e33524..4a07034 100755
--- a/test/1336-short-finalizer-timeout/run
+++ b/test/1336-short-finalizer-timeout/run
@@ -14,6 +14,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# The test logs error messages which is expected, discard them.
+export ANDROID_LOG_TAGS='*:f'
+
 # Squash the exit status and put it in expected
-./default-run "$@" --runtime-option -XX:FinalizerTimeoutMs=500
+./default-run --external-log-tags "$@" --runtime-option -XX:FinalizerTimeoutMs=500
 echo "exit status:" $?