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/178-app-image-native-method/check b/test/178-app-image-native-method/check
index 5336295..45d3654 100755
--- a/test/178-app-image-native-method/check
+++ b/test/178-app-image-native-method/check
@@ -14,5 +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
+
# Filter out error messages for missing native methods.
-grep -v 'No implementation found for ' "$2" | diff -q "$1" - >/dev/null
+diff --strip-trailing-cr -q "$1" "$2" >/dev/null \
+ && grep -v 'No implementation found for ' "$4" | diff -q "$3" - >/dev/null