@@ -320,9 +320,9 @@ if test_options:
320
320
config .swift_test_options += ' '
321
321
config .swift_test_options += test_options
322
322
323
- config .sil_test_options = os .environ .get ('SIL_TEST_OPTIONS ' )
324
- if not config . sil_test_options :
325
- config .sil_test_options = ''
323
+ config .swift_frontend_test_options = os .environ .get ('SWIFT_FRONTEND_TEST_OPTIONS' , ' ' )
324
+ config . swift_driver_test_options = os . environ . get ( 'SWIFT_DRIVER_TEST_OPTIONS' , '' )
325
+ config .sil_test_options = os . environ . get ( 'SIL_TEST_OPTIONS' , '' )
326
326
327
327
clang_module_cache_path = tempfile .mkdtemp (prefix = "swift-testsuite-clang-module-cache" )
328
328
mcp_opt = "-module-cache-path %r" % clang_module_cache_path
@@ -340,8 +340,8 @@ config.substitutions.append( ('%{python}', sys.executable) )
340
340
config .substitutions .append ( ('%mcp_opt' , mcp_opt ) )
341
341
config .substitutions .append ( ('%swift_driver_plain' , "%r" % config .swift ) )
342
342
config .substitutions .append ( ('%swiftc_driver_plain' , "%r" % config .swiftc ) )
343
- config .substitutions .append ( ('%swift_driver' , "env SDKROOT= %r %s %s" % (config .swift , mcp_opt , config .swift_test_options )) )
344
- config .substitutions .append ( ('%swiftc_driver' , "env SDKROOT= %r %s %s" % (config .swiftc , mcp_opt , config .swift_test_options )) )
343
+ config .substitutions .append ( ('%swift_driver' , "env SDKROOT= %r %s %s %s " % (config .swift , mcp_opt , config .swift_test_options , config . swift_driver_test_options )) )
344
+ config .substitutions .append ( ('%swiftc_driver' , "env SDKROOT= %r %s %s %s " % (config .swiftc , mcp_opt , config .swift_test_options , config . swift_driver_test_options )) )
345
345
config .substitutions .append ( ('%sil-opt' , "%r %s %s" % (config .sil_opt , mcp_opt , config .sil_test_options )) )
346
346
config .substitutions .append ( ('%sil-func-extractor' , "%r %s" % (config .sil_func_extractor , mcp_opt )) )
347
347
config .substitutions .append ( ('%sil-llvm-gen' , "%r %s" % (config .sil_llvm_gen , mcp_opt )) )
@@ -360,8 +360,8 @@ config.substitutions.append( ('%llvm-dis', config.llvm_dis) )
360
360
# This must come after all substitutions containing "%swift".
361
361
config .substitutions .append (
362
362
('%swift' ,
363
- "%r -frontend %s -disable-objc-attr-requires-foundation-module %s"
364
- % (config .swift , mcp_opt , config .swift_test_options )) )
363
+ "%r -frontend %s -disable-objc-attr-requires-foundation-module %s %s "
364
+ % (config .swift , mcp_opt , config .swift_test_options , config . swift_frontend_test_options )) )
365
365
366
366
config .clang_include_dir = \
367
367
os .path .join (os .path .dirname (os .path .dirname (config .swift )), 'include' )
@@ -604,11 +604,12 @@ if run_vendor == 'apple':
604
604
(run_cpu , run_os , run_vers , clang_mcp_opt ))
605
605
606
606
config .target_build_swift = (
607
- "%s %s %s -F %s -Xlinker -rpath -Xlinker %s %s %s %s" %
607
+ "%s %s %s -F %s -Xlinker -rpath -Xlinker %s %s %s %s %s " %
608
608
(xcrun_prefix , config .swiftc , target_options ,
609
609
extra_frameworks_dir ,
610
610
"/tmp/swifttest-device/lib" ,
611
611
sdk_overlay_linker_opt , config .swift_test_options ,
612
+ config .swift_driver_test_options ,
612
613
swift_execution_tests_extra_flags ))
613
614
config .target_run = "unsupported"
614
615
@@ -632,10 +633,11 @@ if run_vendor == 'apple':
632
633
(run_cpu , run_os , run_vers , clang_mcp_opt ))
633
634
634
635
config .target_build_swift = (
635
- "%s %s %s -F %s %s %s %s" %
636
+ "%s %s %s -F %s %s %s %s %s " %
636
637
(xcrun_prefix , config .swiftc , target_options ,
637
638
extra_frameworks_dir ,
638
639
sdk_overlay_linker_opt , config .swift_test_options ,
640
+ config .swift_driver_test_options ,
639
641
swift_execution_tests_extra_flags ))
640
642
# FIXME: allow specification of simulator and version
641
643
#
@@ -665,18 +667,20 @@ if run_vendor == 'apple':
665
667
(run_cpu , run_os , run_vers , clang_mcp_opt ))
666
668
667
669
config .target_build_swift = (
668
- "%s %s %s -F %s -Xlinker -rpath -Xlinker %s %s %s %s"
670
+ "%s %s %s -F %s -Xlinker -rpath -Xlinker %s %s %s %s %s "
669
671
% (xcrun_prefix , config .swiftc , target_options ,
670
672
extra_frameworks_dir , extra_frameworks_dir ,
671
673
sdk_overlay_linker_opt , config .swift_test_options ,
674
+ config .swift_driver_test_options ,
672
675
swift_execution_tests_extra_flags ))
673
676
config .target_run = ""
674
677
675
678
if 'interpret' in lit_config .params :
676
679
target_run_base = (
677
- '%s %s %s -module-name main %s %s'
680
+ '%s %s %s -module-name main %s %s %s '
678
681
% (xcrun_prefix , config .swift , target_options ,
679
682
config .swift_test_options ,
683
+ config .swift_driver_test_options ,
680
684
swift_execution_tests_extra_flags ))
681
685
config .target_run_simple_swift = (
682
686
"%s %%s" % (target_run_base ))
@@ -706,13 +710,13 @@ if run_vendor == 'apple':
706
710
"%s ld -L%s" %
707
711
(xcrun_prefix , os .path .join (test_resource_dir , config .target_sdk_name )))
708
712
config .target_swift_frontend = (
709
- "%s -frontend %s -sdk %s %s" %
713
+ "%s -frontend %s -sdk %s %s %s " %
710
714
(config .swiftc , target_options , config .variant_sdk ,
711
- config .swift_test_options ))
715
+ config .swift_test_options , config . swift_frontend_test_options ))
712
716
subst_target_swift_frontend_mock_sdk = (
713
- "%s -frontend %s -sdk %s %s" %
717
+ "%s -frontend %s -sdk %s %s %s " %
714
718
(config .swiftc , target_options_for_mock_sdk , config .variant_sdk ,
715
- config .swift_test_options ))
719
+ config .swift_test_options , config . swift_frontend_test_options ))
716
720
config .target_swift_modulewrap = (
717
721
'%s -modulewrap -target %s' %
718
722
(config .swiftc , config .variant_triple ))
@@ -766,25 +770,27 @@ elif run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'windows-cygnus', 'wi
766
770
config .target_runtime = "native"
767
771
config .target_swift_autolink_extract = inferSwiftBinary ("swift-autolink-extract" )
768
772
config .target_build_swift = (
769
- '%s -target %s %s %s %s %s'
773
+ '%s -target %s %s %s %s %s %s '
770
774
% (config .swiftc , config .variant_triple , resource_dir_opt , mcp_opt ,
771
- config .swift_test_options , swift_execution_tests_extra_flags ))
775
+ config .swift_test_options , config .swift_driver_test_options ,
776
+ swift_execution_tests_extra_flags ))
772
777
config .target_codesign = "echo"
773
778
config .target_build_swift_dylib = (
774
779
"%s -parse-as-library -emit-library -o '\\ 1'"
775
780
% (config .target_build_swift ))
776
781
config .target_swift_frontend = (
777
- '%s -frontend -target %s %s %s %s'
782
+ '%s -frontend -target %s %s %s %s %s '
778
783
% (config .swift , config .variant_triple , resource_dir_opt , mcp_opt ,
779
- config .swift_test_options ))
784
+ config .swift_test_options , config . swift_frontend_test_options ))
780
785
subst_target_swift_frontend_mock_sdk = config .target_swift_frontend
781
786
subst_target_swift_frontend_mock_sdk_after = ""
782
787
config .target_run = ''
783
788
if 'interpret' in lit_config .params :
784
789
target_run_base = (
785
- '%s -target %s %s %s -module-name main %s %s'
790
+ '%s -target %s %s %s -module-name main %s %s %s '
786
791
% (config .swift , config .variant_triple , resource_dir_opt ,
787
792
mcp_opt , config .swift_test_options ,
793
+ config .swift_driver_test_options ,
788
794
swift_execution_tests_extra_flags ))
789
795
config .target_run_simple_swift = (
790
796
'%s %%s' % (target_run_base ))
@@ -837,18 +843,20 @@ elif run_os == 'linux-androideabi':
837
843
"arm-linux-androideabi" ,
838
844
"{}.x" .format (config .android_ndk_gcc_version )))
839
845
config .target_build_swift = (
840
- '%s -target %s -sdk %s %s -Xlinker -pie %s %s %s %s'
846
+ '%s -target %s -sdk %s %s -Xlinker -pie %s %s %s %s %s '
841
847
% (config .swiftc , config .variant_triple , config .variant_sdk ,
842
848
android_linker_opt , resource_dir_opt , mcp_opt ,
843
- config .swift_test_options , swift_execution_tests_extra_flags ))
849
+ config .swift_test_options ,
850
+ config .swift_driver_test_options , swift_execution_tests_extra_flags ))
844
851
config .target_codesign = "echo"
845
852
config .target_build_swift_dylib = (
846
853
"%s -parse-as-library -emit-library -o '\\ 1'"
847
854
% (config .target_build_swift ))
848
855
config .target_swift_frontend = (
849
- '%s -frontend -target %s -sdk %s %s %s %s'
856
+ '%s -frontend -target %s -sdk %s %s %s %s %s '
850
857
% (config .swift , config .variant_triple , config .variant_sdk ,
851
- android_linker_opt , resource_dir_opt , mcp_opt ))
858
+ android_linker_opt , resource_dir_opt , mcp_opt ,
859
+ config .swift_frontend_test_options ))
852
860
subst_target_swift_frontend_mock_sdk = config .target_swift_frontend
853
861
subst_target_swift_frontend_mock_sdk_after = ""
854
862
config .target_run = os .path .join (
0 commit comments