15
15
TMP_RESULTS_FILE = "tmp-results-file.json"
16
16
17
17
def get_cts_test_suite_names (working_directory ):
18
- process = Popen (["ctest" , "--show-only=json-v1" ], cwd = working_directory ,
18
+ process = Popen (["ctest" , "--show-only=json-v1" ], cwd = working_directory ,
19
19
stdout = PIPE , env = os .environ .copy ())
20
20
out ,_ = process .communicate ()
21
21
testsuites = json .loads (out )
22
- return [test ['name' ]for test in testsuites ['tests' ]]
22
+ return [
23
+ test ['name' ][:test ['name' ].rfind ('-' )] for test in testsuites ['tests' ]
24
+ ]
23
25
24
26
def percent (amount , total ):
25
27
return round ((amount / total ) * 100 , 2 )
@@ -39,7 +41,7 @@ def summarize_results(results):
39
41
crash_rate = percent (total_crashed , total )
40
42
41
43
ljust_param = len (str (total ))
42
-
44
+
43
45
print (
44
46
f"""[CTest Parser] Results:
45
47
Total [{ str (total ).ljust (ljust_param )} ]
@@ -85,7 +87,7 @@ def run(args):
85
87
results [suite ] = {}
86
88
test_executable = f"{ args .ctest_path } /bin/test-{ suite } "
87
89
process = Popen ([test_executable , "--gtest_list_tests" ], env = env ,
88
- stdout = DEVNULL if args .quiet else None ,
90
+ stdout = DEVNULL if args .quiet else None ,
89
91
stderr = DEVNULL if args .quiet else None )
90
92
process .wait ()
91
93
try :
@@ -98,8 +100,8 @@ def run(args):
98
100
99
101
for suite in test_suite_names :
100
102
ctest_path = f"{ args .ctest_path } /test/conformance/{ suite } "
101
- process = Popen (['ctest' ,ctest_path ], env = env , cwd = ctest_path ,
102
- stdout = DEVNULL if args .quiet else None ,
103
+ process = Popen (['ctest' ,ctest_path ], env = env , cwd = ctest_path ,
104
+ stdout = DEVNULL if args .quiet else None ,
103
105
stderr = DEVNULL if args .quiet else None )
104
106
process .wait ()
105
107
@@ -111,7 +113,7 @@ def run(args):
111
113
except FileNotFoundError :
112
114
results [suite ]['actual' ] = None
113
115
print ('\033 [91m' + f"Conformance test suite '{ suite } ' : likely crashed!" + '\033 [0m' )
114
-
116
+
115
117
return results
116
118
117
119
def dir_path (string ):
0 commit comments