1+ #!/usr/bin/python3
2+ import sys , time
3+
4+ from program_input import p_input
5+ from main import test_conf_file
6+ from parse_input import *
7+
8+ project = p_input ["project" ]
9+ mapping = parse_mapping (p_input ["mapping_path" ])
10+ from run_test import run_test_batch
11+
12+ def main (argv ):
13+ print (">>>>[ctest_core] running project {}" .format (project ))
14+ s = time .time ()
15+ ctestname = argv [1 ]
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 ))
23+
24+ def test_conf_file (test_input , ctestname ):
25+ params = test_input .keys ()
26+ associated_test_map = {p : [ctestname ] for p in params if ctestname in mapping [p ]}
27+ print (">>>>[ctest_core] # parameters associated with the run: {}" .format (len (params )))
28+ tr = run_test_batch (test_input , associated_test_map )
29+ tup = tr .ran_tests_and_time .pop ()
30+ test , _ = tup .split ("\t " )
31+ if test in tr .failed_tests :
32+ print (">>>>[ctest_core] The single ctest FAIL" )
33+ else :
34+ print (">>>>[ctest_core] The single ctest PASS" )
35+
36+ if __name__ == "__main__" :
37+ main (sys .argv )
0 commit comments