Skip to content

Commit 49951b8

Browse files
authored
Merge pull request #302 from ahoppen/pr/no-lit-test
Add option to build-script to skip running lit-based tests
2 parents df40ff8 + 265f2e8 commit 49951b8

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

build-script.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -395,17 +395,21 @@ def check_generated_files_match(self_generated_dir, user_generated_dir):
395395

396396

397397
def run_tests(
398-
toolchain, build_dir, multiroot_data_file, release, filecheck_exec, verbose
398+
toolchain, build_dir, multiroot_data_file, release, filecheck_exec,
399+
skip_lit_tests, verbose
399400
):
400401
print("** Running SwiftSyntax Tests **")
401402

402-
lit_success = run_lit_tests(
403-
toolchain=toolchain,
404-
build_dir=build_dir,
405-
release=release,
406-
filecheck_exec=filecheck_exec,
407-
verbose=verbose,
408-
)
403+
if skip_lit_tests:
404+
lit_success = True
405+
else:
406+
lit_success = run_lit_tests(
407+
toolchain=toolchain,
408+
build_dir=build_dir,
409+
release=release,
410+
filecheck_exec=filecheck_exec,
411+
verbose=verbose,
412+
)
409413
if not lit_success:
410414
return False
411415

@@ -704,6 +708,10 @@ def parse_args():
704708

705709
test_group.add_argument("-t", "--test", action="store_true", help="Run tests")
706710

711+
test_group.add_argument("--skip-lit-tests", action="store_true",
712+
help="Don't run lit-based tests"
713+
)
714+
707715
test_group.add_argument(
708716
"--filecheck-exec",
709717
default=None,
@@ -814,6 +822,7 @@ def main():
814822
multiroot_data_file=args.multiroot_data_file,
815823
release=args.release,
816824
filecheck_exec=realpath(args.filecheck_exec),
825+
skip_lit_tests=args.skip_lit_tests,
817826
verbose=args.verbose,
818827
)
819828
if not success:

0 commit comments

Comments
 (0)