@@ -49,27 +49,23 @@ def is_before_build_script_impl_product(cls):
49
49
def is_swiftpm_unified_build_product (cls ):
50
50
return True
51
51
52
- def run_swiftsyntax_build_script (self , target , additional_params = []):
52
+ def run_swiftsyntax_build_script (self , target , command , additional_params = []):
53
53
llvm_build_dir = os .path .join (self .build_dir , '..' , 'llvm-' + target )
54
54
llvm_build_dir = os .path .realpath (llvm_build_dir )
55
55
56
56
script_path = os .path .join (self .source_dir , 'build-script.py' )
57
57
58
58
build_cmd = [
59
59
script_path ,
60
+ command ,
60
61
'--build-dir' , self .build_dir ,
61
62
'--multiroot-data-file' , MULTIROOT_DATA_FILE_PATH ,
62
- '--toolchain' , self .install_toolchain_path (target ),
63
- '--filecheck-exec' , os .path .join (llvm_build_dir , 'bin' ,
64
- 'FileCheck' ),
63
+ '--toolchain' , self .install_toolchain_path (target )
65
64
]
66
65
67
66
if self .is_release ():
68
67
build_cmd .append ('--release' )
69
68
70
- if self .args .swiftsyntax_verify_generated_files :
71
- build_cmd .append ('--verify-generated-files' )
72
-
73
69
build_cmd .extend (additional_params )
74
70
75
71
if self .args .verbose_build :
@@ -81,14 +77,22 @@ def should_build(self, host_target):
81
77
return True
82
78
83
79
def build (self , host_target ):
84
- self .run_swiftsyntax_build_script (target = host_target )
80
+ self .run_swiftsyntax_build_script (target = host_target ,
81
+ command = 'build' )
85
82
86
83
def should_test (self , host_target ):
87
84
return self .args .test_swiftsyntax
88
85
89
86
def test (self , host_target ):
90
87
self .run_swiftsyntax_build_script (target = host_target ,
91
- additional_params = ['--test' ])
88
+ command = 'verify-source-code' )
89
+
90
+ self .run_swiftsyntax_build_script (target = host_target ,
91
+ command = 'test'
92
+ additional_params = [
93
+ '--filecheck-exec' , os .path .join (llvm_build_dir , 'bin' ,
94
+ 'FileCheck' )
95
+ ])
92
96
93
97
def should_install (self , host_target ):
94
98
return self .args .install_swiftsyntax
0 commit comments