@@ -129,7 +129,7 @@ def ignore_the_case(
129129 return False
130130
131131
132- def preflight_check (aot_flag , eh_flag ):
132+ def preflight_check (aot_flag , aot_compiler , eh_flag ):
133133 if not pathlib .Path (SPEC_TEST_DIR ).resolve ().exists ():
134134 print (f"Can not find { SPEC_TEST_DIR } " )
135135 return False
@@ -138,8 +138,8 @@ def preflight_check(aot_flag, eh_flag):
138138 print (f"Can not find { WAST2WASM_CMD } " )
139139 return False
140140
141- if aot_flag and not pathlib .Path (WAMRC_CMD ).resolve ().exists ():
142- print (f"Can not find { WAMRC_CMD } " )
141+ if aot_flag and not pathlib .Path (aot_compiler ).resolve ().exists ():
142+ print (f"Can not find { aot_compiler } " )
143143 return False
144144
145145 return True
@@ -149,6 +149,7 @@ def test_case(
149149 case_path ,
150150 target ,
151151 aot_flag = False ,
152+ aot_compiler = WAMRC_CMD ,
152153 sgx_flag = False ,
153154 multi_module_flag = False ,
154155 multi_thread_flag = False ,
@@ -177,7 +178,7 @@ def test_case(
177178 if no_pty :
178179 CMD .append ("--no-pty" )
179180 CMD .append ("--aot-compiler" )
180- CMD .append (WAMRC_CMD )
181+ CMD .append (aot_compiler )
181182
182183 if aot_flag :
183184 CMD .append ("--aot" )
@@ -274,6 +275,7 @@ def test_case(
274275def test_suite (
275276 target ,
276277 aot_flag = False ,
278+ aot_compiler = WAMRC_CMD ,
277279 sgx_flag = False ,
278280 multi_module_flag = False ,
279281 multi_thread_flag = False ,
@@ -348,6 +350,7 @@ def test_suite(
348350 str (case_path ),
349351 target ,
350352 aot_flag ,
353+ aot_compiler ,
351354 sgx_flag ,
352355 multi_module_flag ,
353356 multi_thread_flag ,
@@ -389,6 +392,7 @@ def test_suite(
389392 str (case_path ),
390393 target ,
391394 aot_flag ,
395+ aot_compiler ,
392396 sgx_flag ,
393397 multi_module_flag ,
394398 multi_thread_flag ,
@@ -470,6 +474,12 @@ def main():
470474 dest = "aot_flag" ,
471475 help = "Running with AOT mode" ,
472476 )
477+ parser .add_argument (
478+ "--aot-compiler" ,
479+ default = WAMRC_CMD ,
480+ dest = "aot_compiler" ,
481+ help = "AOT compiler" ,
482+ )
473483 parser .add_argument (
474484 "-x" ,
475485 action = "store_true" ,
@@ -550,7 +560,7 @@ def main():
550560 if options .target == "x86_32" :
551561 options .target = "i386"
552562
553- if not preflight_check (options .aot_flag , options .eh_flag ):
563+ if not preflight_check (options .aot_flag , options .aot_compiler , options . eh_flag ):
554564 return False
555565
556566 if not options .cases :
@@ -564,6 +574,7 @@ def main():
564574 ret = test_suite (
565575 options .target ,
566576 options .aot_flag ,
577+ options .aot_compiler ,
567578 options .sgx_flag ,
568579 options .multi_module_flag ,
569580 options .multi_thread_flag ,
@@ -591,6 +602,7 @@ def main():
591602 case ,
592603 options .target ,
593604 options .aot_flag ,
605+ options .aot_compiler ,
594606 options .sgx_flag ,
595607 options .multi_module_flag ,
596608 options .multi_thread_flag ,
0 commit comments