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