From 61d6663a04b10636c90488e9e5046dccaef3ed5d Mon Sep 17 00:00:00 2001 From: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Date: Mon, 19 Jul 2021 19:51:01 -0700 Subject: [PATCH] Added a test filter for objc tests (flutter/engine#27566) --- engine/src/flutter/testing/run_tests.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/testing/run_tests.py b/engine/src/flutter/testing/run_tests.py index 9897881e7a..72f13dfece 100755 --- a/engine/src/flutter/testing/run_tests.py +++ b/engine/src/flutter/testing/run_tests.py @@ -332,7 +332,7 @@ def RunJavaTests(filter, android_variant='android_debug_unopt'): RunCmd(command) -def RunObjcTests(ios_variant='ios_debug_sim_unopt'): +def RunObjcTests(ios_variant='ios_debug_sim_unopt', test_filter=None): """Runs Objective-C XCTest unit tests for the iOS embedding""" AssertExpectedXcodeVersion() ios_out_dir = os.path.join(out_dir, ios_variant) @@ -352,6 +352,8 @@ def RunObjcTests(ios_variant='ios_debug_sim_unopt'): 'test ' 'FLUTTER_ENGINE=' + ios_variant ] + if test_filter != None: + command[0] = command[0] + " -only-testing:%s" % test_filter RunCmd(command, cwd=ios_unit_test_dir, shell=True) def RunDartTests(build_dir, filter, verbose_dart_snapshot): @@ -509,6 +511,8 @@ def main(): help='The engine build variant to run objective-c tests for') parser.add_argument('--verbose-dart-snapshot', dest='verbose_dart_snapshot', action='store_true', default=False, help='Show extra dart snapshot logging.') + parser.add_argument('--objc-filter', type=str, default=None, + help='Filter parameter for which objc tests to run (example: "IosUnitTestsTests/SemanticsObjectTest/testShouldTriggerAnnouncement")') args = parser.parse_args() @@ -546,7 +550,7 @@ def main(): if 'objc' in types: assert IsMac(), "iOS embedding tests can only be run on macOS." - RunObjcTests(args.ios_variant) + RunObjcTests(args.ios_variant, args.objc_filter) # https://github.com/flutter/flutter/issues/36300 if 'benchmarks' in types and not IsWindows():