9 print "table {border-collapse: collapse; table-layout: fixed;}"
10 print "td {border-style: solid; border-width: 1px; border-color: grey;}"
16 print "<h1>Imago test</h1>"
20 res = pickle.load(open(sys.argv[1], 'r'))
24 failed = [(name,error) for (name, time, output, error, r_code) in res
26 print "failed tests:", str(len(failed)) + '/' + str(total)
28 for (name, error) in failed:
37 for (name, time, output, error, r_code) in res:
42 ref = open(name.split('.')[0] + '.txt').read()
46 #TODO find and record the error
49 print "average runtime:", (t/n)
50 print "correct:", str(correct) + '/' + str(n)
54 for (name, time, output, error, r_code) in res:
56 print "<h2>" + name + "</h2>"
57 print "<image src=\"" + name + "\" width=\"600\" style=\"float: right;\" />"
59 output = output.split('\n')
60 correct = open(name[:-4]+".txt").readlines()
61 output = map(lambda s: s.split(), output)
62 correct = map(lambda s: s.split(), correct)
63 for i in range(len(output)):
65 for j in range(len(output[i])):
66 if output[i][j] == correct[i][j]:
67 print "<td><div style=\"width: 15px\" >{}</td>".format(output[i][j])
69 print "<td><div style=\"background-color: red; \
70 width: 15px\">{}</td>".format(output[i][j])
73 print "<div style=\"clear: both;\"></div>"