Verify ART run-tests' standard output and standard error separately.

Introduce expected standard error files for ART run-tests. Collect
tests' standard output and standard error separately and check them
against the corresponding expectation file.

Test: Run ART run-tests on host and device using `testrunner.py`.
Test: atest --test-mapping art:all
Test: atest --test-mapping cts/hostsidetests/jvmti:all
Bug: 171865375
Bug: 147812905
Change-Id: Ie95bec4a4684ff6791d464124ce8976339432d1f
diff --git a/test/148-multithread-gc-annotations/check b/test/148-multithread-gc-annotations/check
index 842bdc6..67fcafb 100755
--- a/test/148-multithread-gc-annotations/check
+++ b/test/148-multithread-gc-annotations/check
@@ -14,9 +14,12 @@
 # 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
+
 # Check that the string "error" isn't present
-if grep error "$2"; then
-    exit 1
-else
-    exit 0
-fi
+grep -vq error "$2"  \
+  && diff --strip-trailing-cr -q "$3" "$4" >/dev/null