Skip to content

Commit dbc96f4

Browse files
committed
[libc++] Escape spaces in GoogleBenchmark microbenchmarks
Otherwise we generate data that isn't valid according to the LNT format.
1 parent 1287ed1 commit dbc96f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libcxx/utils/parse-google-benchmark-results

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ def main(argv):
4141
benchmark = headers.index('Benchmark')
4242
time = headers.index(args.timing)
4343
for row in rows:
44-
print(f'{row[benchmark].replace(".", "_")}.execution_time {row[time]}')
44+
# LNT format uses '.' to separate the benchmark name from the metric, and ' '
45+
# to separate the benchmark name + metric from the numerical value. Escape both.
46+
escaped = row[benchmark].replace(".", "_").replace(" ", "_")
47+
print(f'{escaped}.execution_time {row[time]}')
4548

4649
if __name__ == '__main__':
4750
main(sys.argv[1:])

0 commit comments

Comments
 (0)