summaryrefslogtreecommitdiff
path: root/test/2232-write-metrics-to-log
diff options
context:
space:
mode:
Diffstat (limited to 'test/2232-write-metrics-to-log')
-rw-r--r--test/2232-write-metrics-to-log/Android.bp2
-rwxr-xr-xtest/2232-write-metrics-to-log/check34
-rw-r--r--test/2232-write-metrics-to-log/expected-stderr.txt1
-rw-r--r--[-rwxr-xr-x]test/2232-write-metrics-to-log/run.py (renamed from test/2232-write-metrics-to-log/run)16
4 files changed, 16 insertions, 37 deletions
diff --git a/test/2232-write-metrics-to-log/Android.bp b/test/2232-write-metrics-to-log/Android.bp
index a64567e0f0..6a1e68c1fd 100644
--- a/test/2232-write-metrics-to-log/Android.bp
+++ b/test/2232-write-metrics-to-log/Android.bp
@@ -15,7 +15,7 @@ package {
java_test {
name: "art-run-test-2232-write-metrics-to-log",
defaults: ["art-run-test-defaults"],
- test_config_template: ":art-run-test-target-template",
+ test_config_template: ":art-run-test-target-no-test-suite-tag-template",
srcs: ["src/**/*.java"],
data: [
":art-run-test-2232-write-metrics-to-log-expected-stdout",
diff --git a/test/2232-write-metrics-to-log/check b/test/2232-write-metrics-to-log/check
deleted file mode 100755
index d12e8b126d..0000000000
--- a/test/2232-write-metrics-to-log/check
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-#
-# 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.
-# 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.
-
-# 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 one of the metrics appears in stderr.
-grep 'ClassVerificationTotalTime' "$4" >/dev/null
-MSG_FOUND=$?
-
-if [[ $MSG_FOUND -ne 0 ]] ; then
- # Print out the log and return with error.
- cat "$4"
- exit 1
-fi
-
-# Success.
-exit 0
diff --git a/test/2232-write-metrics-to-log/expected-stderr.txt b/test/2232-write-metrics-to-log/expected-stderr.txt
index e69de29bb2..5bc27fe98f 100644
--- a/test/2232-write-metrics-to-log/expected-stderr.txt
+++ b/test/2232-write-metrics-to-log/expected-stderr.txt
@@ -0,0 +1 @@
+ClassVerificationTotalTimeDelta
diff --git a/test/2232-write-metrics-to-log/run b/test/2232-write-metrics-to-log/run.py
index d34ec6c0eb..89fe040087 100755..100644
--- a/test/2232-write-metrics-to-log/run
+++ b/test/2232-write-metrics-to-log/run.py
@@ -14,5 +14,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-export ANDROID_LOG_TAGS="*:i"
-exec ${RUN} $@ --external-log-tags --runtime-option -Xmetrics-write-to-logcat:true --runtime-option -Xmetrics-reporting-mods:100
+
+def run(ctx, args):
+ ctx.default_run(
+ args,
+ android_log_tags="*:i",
+ diff_min_log_tag="i",
+ runtime_option=[
+ "-Xmetrics-write-to-logcat:true", "-Xmetrics-reporting-mods:100"
+ ])
+
+ # Check that one of the metrics appears in stderr.
+ ctx.run(
+ fr"sed -i -n 's/.*\(ClassVerificationTotalTimeDelta\).*/\1/p' '{args.stderr_file}'"
+ )