Skip to content

Commit 40eaaac

Browse files
committed
Do not use --json for listing tests (yet)
1 parent 998475b commit 40eaaac

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

benchmark/scripts/Benchmark_Driver

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ class BenchmarkDriver(object):
136136

137137
@property
138138
def _cmd_list_benchmarks(self):
139-
return [self.test_harness, "--list", "--json"] + (
139+
# TODO: Switch to JSON format: add "--json" here
140+
return [self.test_harness, "--list"] + (
140141
["--skip-tags="] if (self.args.benchmarks or self.args.filters) else []
141142
)
142143

@@ -145,8 +146,19 @@ class BenchmarkDriver(object):
145146
lines = self._invoke(self._cmd_list_benchmarks).split("\n")
146147
json_tests = []
147148
for line in lines:
148-
if line.strip() != "":
149-
json_tests.append(json.loads(line))
149+
columns = re.split(r'[ ,]+', line.strip())
150+
try:
151+
number = int(columns[0])
152+
name = columns[1]
153+
json = {"number": number, "name": name}
154+
json_tests.append(json)
155+
except Exception as e:
156+
continue
157+
# TODO: Replace the above with the following to
158+
# use the JSON output from the benchmark driver
159+
# directly
160+
#if line.strip() != "":
161+
# json_tests.append(json.loads(line))
150162
self.all_tests = [json["name"] for json in json_tests]
151163
test_numbers = [json["number"] for json in json_tests]
152164
self.test_number = dict([(json["name"], json["number"]) for json in json_tests])

0 commit comments

Comments
 (0)