55from main import test_conf_file
66from parse_input import *
77
8- run_mode = p_input ["run_mode" ]
98project = p_input ["project" ]
109mapping = parse_mapping (p_input ["mapping_path" ])
1110from run_test import run_test_batch
@@ -14,26 +13,21 @@ def main(argv):
1413 print (">>>>[ctest_core] running project {}" .format (project ))
1514 s = time .time ()
1615 ctestname = argv [1 ]
17- if run_mode == "run_ctest" :
18- print ("Please use the run_single_ctest mode" )
19- return
20- elif run_mode == "run_single_ctest" :
21- param_value_dict = {}
22- for i in range (2 , len (argv )):
23- param , value = argv [i ].split ('=' )
24- param_value_dict [param ] = value
25- test_input = extract_conf_diff_from_pair (param_value_dict )
26- test_conf_file (test_input , ctestname )
27- print (">>>>[ctest_core] total time: {} seconds" .format (time .time () - s ))
16+ param_value_dict = {}
17+ for i in range (2 , len (argv )):
18+ param , value = argv [i ].split ('=' )
19+ param_value_dict [param ] = value
20+ test_input = extract_conf_diff_from_pair (param_value_dict )
21+ test_conf_file (test_input , ctestname )
22+ print (">>>>[ctest_core] total time: {} seconds" .format (time .time () - s ))
2823
2924def test_conf_file (test_input , ctestname ):
3025 params = test_input .keys ()
31- associated_test_map = dict ([[i , list ((ctestname , ))] for i in params if ctestname in mapping [i ]])
32- associated_tests = set ((ctestname , ))
26+ associated_test_map = {p : [ctestname ] for p in params if ctestname in mapping [p ]}
3327 print (">>>>[ctest_core] # parameters associated with the run: {}" .format (len (params )))
3428 tr = run_test_batch (test_input , associated_test_map )
3529 tup = tr .ran_tests_and_time .pop ()
36- test , mvntime = tup .split ("\t " )
30+ test , _ = tup .split ("\t " )
3731 if test in tr .failed_tests :
3832 print (">>>>[ctest_core] The single ctest FAIL" )
3933 else :
0 commit comments