5
5
from main import test_conf_file
6
6
from parse_input import *
7
7
8
- run_mode = p_input ["run_mode" ]
9
8
project = p_input ["project" ]
10
9
mapping = parse_mapping (p_input ["mapping_path" ])
11
10
from run_test import run_test_batch
@@ -14,26 +13,21 @@ def main(argv):
14
13
print (">>>>[ctest_core] running project {}" .format (project ))
15
14
s = time .time ()
16
15
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 ))
28
23
29
24
def test_conf_file (test_input , ctestname ):
30
25
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 ]}
33
27
print (">>>>[ctest_core] # parameters associated with the run: {}" .format (len (params )))
34
28
tr = run_test_batch (test_input , associated_test_map )
35
29
tup = tr .ran_tests_and_time .pop ()
36
- test , mvntime = tup .split ("\t " )
30
+ test , _ = tup .split ("\t " )
37
31
if test in tr .failed_tests :
38
32
print (">>>>[ctest_core] The single ctest FAIL" )
39
33
else :
0 commit comments