@@ -523,22 +523,33 @@ def check_incr_transfer_roundtrip_exec() -> None:
523
523
)
524
524
525
525
526
- def find_lit_test_helper_exec (
527
- toolchain : str , build_dir : Optional [str ], release : bool
526
+ def find_swiftpm_bin_path (
527
+ package_dir : str , toolchain : str , build_dir : Optional [str ], release : bool
528
528
) -> str :
529
529
swiftpm_call = get_swiftpm_invocation (
530
530
toolchain = toolchain ,
531
531
action = "build" ,
532
- package_dir = PACKAGE_DIR ,
532
+ package_dir = package_dir ,
533
533
build_dir = build_dir ,
534
534
multiroot_data_file = None ,
535
535
release = release ,
536
536
)
537
- swiftpm_call .extend (["--product" , "lit-test-helper" ])
538
537
swiftpm_call .extend (["--show-bin-path" ])
539
538
540
539
bin_dir = subprocess .check_output (swiftpm_call )
541
- return os .path .join (bin_dir .strip ().decode ('utf-8' ), "lit-test-helper" )
540
+ return bin_dir .strip ().decode ('utf-8' )
541
+
542
+
543
+ def find_product_bin_path (
544
+ toolchain : str , build_dir : Optional [str ], release : bool
545
+ ) -> str :
546
+ return find_swiftpm_bin_path (PACKAGE_DIR , toolchain , build_dir , release )
547
+
548
+
549
+ def find_examples_bin_path (
550
+ toolchain : str , build_dir : Optional [str ], release : bool
551
+ ) -> str :
552
+ return find_swiftpm_bin_path (EXAMPLES_DIR , toolchain , build_dir , release )
542
553
543
554
544
555
def run_lit_tests (toolchain : str , build_dir : Optional [str ], release : bool ,
@@ -548,9 +559,12 @@ def run_lit_tests(toolchain: str, build_dir: Optional[str], release: bool,
548
559
check_lit_exec ()
549
560
check_incr_transfer_roundtrip_exec ()
550
561
551
- lit_test_helper_exec = find_lit_test_helper_exec (
552
- toolchain = toolchain , build_dir = build_dir , release = release
553
- )
562
+ product_bin_path = find_product_bin_path (
563
+ toolchain = toolchain , build_dir = build_dir , release = release )
564
+ examples_bin_path = find_examples_bin_path (
565
+ toolchain = toolchain , build_dir = build_dir , release = release )
566
+
567
+ lit_test_helper_exec = os .path .join (product_bin_path , "lit-test-helper" )
554
568
555
569
lit_call = ["python3" , LIT_EXEC ]
556
570
lit_call .append (os .path .join (PACKAGE_DIR , "lit_tests" ))
@@ -562,11 +576,7 @@ def run_lit_tests(toolchain: str, build_dir: Optional[str], release: bool,
562
576
lit_call .extend (
563
577
["--param" , "INCR_TRANSFER_ROUND_TRIP.PY=" + INCR_TRANSFER_ROUNDTRIP_EXEC ]
564
578
)
565
-
566
- build_subdir = 'release' if release else 'debug'
567
- package_build_dir = build_dir + '/' + build_subdir
568
-
569
- lit_call .extend (["--param" , "BUILD_DIR=" + package_build_dir ])
579
+ lit_call .extend (["--param" , "EXAMPLES_BIN_PATH=" + examples_bin_path ])
570
580
lit_call .extend (["--param" , "TOOLCHAIN=" + toolchain ])
571
581
572
582
# Print all failures
@@ -662,7 +672,7 @@ def verify_source_code_command(args: argparse.Namespace) -> None:
662
672
def build_command (args : argparse .Namespace ) -> None :
663
673
try :
664
674
builder = Builder (
665
- toolchain = args .toolchain ,
675
+ toolchain = realpath ( args .toolchain ) ,
666
676
build_dir = realpath (args .build_dir ),
667
677
multiroot_data_file = args .multiroot_data_file ,
668
678
release = args .release ,
@@ -685,7 +695,7 @@ def build_command(args: argparse.Namespace) -> None:
685
695
def test_command (args : argparse .Namespace ) -> None :
686
696
try :
687
697
builder = Builder (
688
- toolchain = args .toolchain ,
698
+ toolchain = realpath ( args .toolchain ) ,
689
699
build_dir = realpath (args .build_dir ),
690
700
multiroot_data_file = args .multiroot_data_file ,
691
701
release = args .release ,
@@ -697,7 +707,7 @@ def test_command(args: argparse.Namespace) -> None:
697
707
builder .buildExample ("ExamplePlugin" )
698
708
699
709
run_tests (
700
- toolchain = args .toolchain ,
710
+ toolchain = realpath ( args .toolchain ) ,
701
711
build_dir = realpath (args .build_dir ),
702
712
multiroot_data_file = args .multiroot_data_file ,
703
713
release = args .release ,
0 commit comments