Skip to content

Commit 3c568c3

Browse files
committed
[CTS] Update ctest_parser.py script
Update the `scripts/ctest_parser.py` to work with the adapter branch changes.
1 parent fe2735a commit 3c568c3

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

scripts/ctest_parser.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
TMP_RESULTS_FILE = "tmp-results-file.json"
1616

1717
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,
1919
stdout=PIPE, env=os.environ.copy())
2020
out,_ = process.communicate()
2121
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+
]
2325

2426
def percent(amount, total):
2527
return round((amount / total) * 100, 2)
@@ -39,7 +41,7 @@ def summarize_results(results):
3941
crash_rate = percent(total_crashed, total)
4042

4143
ljust_param = len(str(total))
42-
44+
4345
print(
4446
f"""[CTest Parser] Results:
4547
Total [{str(total).ljust(ljust_param)}]
@@ -85,7 +87,7 @@ def run(args):
8587
results[suite] = {}
8688
test_executable = f"{args.ctest_path}/bin/test-{suite}"
8789
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,
8991
stderr=DEVNULL if args.quiet else None)
9092
process.wait()
9193
try:
@@ -98,8 +100,8 @@ def run(args):
98100

99101
for suite in test_suite_names:
100102
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,
103105
stderr=DEVNULL if args.quiet else None)
104106
process.wait()
105107

@@ -111,7 +113,7 @@ def run(args):
111113
except FileNotFoundError:
112114
results[suite]['actual'] = None
113115
print('\033[91m' + f"Conformance test suite '{suite}' : likely crashed!" + '\033[0m')
114-
116+
115117
return results
116118

117119
def dir_path(string):

0 commit comments

Comments
 (0)