Skip to content

Commit

Permalink
version after review
Browse files Browse the repository at this point in the history
  • Loading branch information
xylian86 committed Jun 30, 2021
1 parent 17db75e commit f015cef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
3 changes: 1 addition & 2 deletions core/run_ctest/program_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
assert p_input["project"] \
and p_input["mapping_path"] \
and p_input["conf_file_dir"], ">>>>[ctest_core] please specify input"
assert p_input["run_mode"] == "run_ctest" \
or p_input["run_mode"] == "run_single_ctest", ">>>>[ctest_core] please specify run_mode"
assert p_input["run_mode"] == "run_ctest", ">>>>[ctest_core] please specify run_mode"
24 changes: 9 additions & 15 deletions core/run_ctest/run_single_ctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from main import test_conf_file
from parse_input import *

run_mode = p_input["run_mode"]
project = p_input["project"]
mapping = parse_mapping(p_input["mapping_path"])
from run_test import run_test_batch
Expand All @@ -14,26 +13,21 @@ def main(argv):
print(">>>>[ctest_core] running project {}".format(project))
s = time.time()
ctestname = argv[1]
if run_mode == "run_ctest":
print("Please use the run_single_ctest mode")
return
elif run_mode == "run_single_ctest":
param_value_dict = {}
for i in range(2, len(argv)):
param, value = argv[i].split('=')
param_value_dict[param] = value
test_input = extract_conf_diff_from_pair(param_value_dict)
test_conf_file(test_input, ctestname)
print(">>>>[ctest_core] total time: {} seconds".format(time.time() - s))
param_value_dict = {}
for i in range(2, len(argv)):
param, value = argv[i].split('=')
param_value_dict[param] = value
test_input = extract_conf_diff_from_pair(param_value_dict)
test_conf_file(test_input, ctestname)
print(">>>>[ctest_core] total time: {} seconds".format(time.time() - s))

def test_conf_file(test_input, ctestname):
params = test_input.keys()
associated_test_map = dict([[i, list((ctestname, ))] for i in params if ctestname in mapping[i]])
associated_tests = set((ctestname, ))
associated_test_map = {p: [ctestname] for p in params if ctestname in mapping[p]}
print(">>>>[ctest_core] # parameters associated with the run: {}".format(len(params)))
tr = run_test_batch(test_input, associated_test_map)
tup = tr.ran_tests_and_time.pop()
test, mvntime = tup.split("\t")
test, _ = tup.split("\t")
if test in tr.failed_tests:
print(">>>>[ctest_core] The single ctest FAIL")
else:
Expand Down
2 changes: 1 addition & 1 deletion core/run_ctest/show_pset.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def main(argv):
if argv[1] in value:
count += 1
print("p", count," ", key, sep='')
print("Number of parameter is", count)
print("Number of parameter(s) is", count)

if __name__ == "__main__":
main(sys.argv)

0 comments on commit f015cef

Please sign in to comment.