Android: Add a way to prepare traces without running tests

Example:
    % out/Android/angle_trace_tests --gtest_filter='*gacha_life' --prepare-only
    ...
    Prepared traces: {'gacha_life'}

Can be used as a setup for running restricted_trace_perf.py

Bug: b/292249127
Change-Id: I901c086a19e1d182c64ec4150ced98c198e21c4d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4711826
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
This commit is contained in:
Roman Lavrov
2023-07-24 11:53:02 -04:00
committed by Angle LUCI CQ
parent 5e21d7f024
commit 2d999f7448

View File

@@ -66,6 +66,10 @@ def RunAndroidTestSuite(args, extra_args):
traces = set(android_helper.GetTraceFromTestName(test) for test in tests)
android_helper.PrepareRestrictedTraces(traces)
if args.prepare_only:
print('Prepared traces: %s' % traces)
return 0
flags = ['--gtest_filter=' + args.filter] if args.filter else []
return android_helper.RunTests(args.suite, flags + extra_args)[0]
@@ -76,6 +80,7 @@ def main():
parser.add_argument('--output-directory', required=True)
parser.add_argument('--wrapper-script-args')
parser.add_argument('--runtime-deps-path')
parser.add_argument('--prepare-only', action='store_true')
AddCommonParserArgs(parser)
args, extra_args = parser.parse_known_args()