Skip to content

Commit

Permalink
Added a test filter for objc tests (flutter#27566)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaaclarke authored Jul 20, 2021
1 parent dd95642 commit b477645
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit b477645

Please sign in to comment.