#!/usr/bin/python # # Format a perftest text dump into a HTML table. import os import sys import re def main(): # test-try-catch-throw.js : duk.O2.alt0 40.70 duk.O2.alt0f 40.74 duk.O2.alt1 40.10 duk.O2.alt1a 39.91 duk.O2.alt2 40.10 duk.O2.alt3 39.77 duk.O2.master 40.01 duk.O2.130 38.08 re_line = re.compile(r'^(\S+)\s*:\s*(.*?)$') re_part = re.compile(r'\S+') first = True with open(sys.argv[1], 'rb') as f_in, open(sys.argv[2], 'wb') as f_out: f_out.write('\n') f_out.write('\n') f_out.write('
\n') f_out.write("""\ """) f_out.write('\n') f_out.write('\n') f_out.write('') for idx in xrange(0, len(parts), 2): f_out.write(' | ' + parts[idx] + ' | ') f_out.write('
---|---|
' + testname + ' | ') for idx in xrange(1, len(parts), 2): f_out.write('' + parts[idx] + ' | ') f_out.write('