--- /dev/null
+#!/usr/bin/env python
+
+import sys
+
+print "<html>"
+print "<head>"
+print "<style>"
+print "pre {line-height: 80%;}"
+print "</style>"
+print "</head>"
+
+print "<body>"
+
+print "<h1>Imago test</h1>"
+
+for fl in sys.argv[1:]:
+ print "<div>"
+ print "<h2>" + fl[:-4] + ".jpg" + "</h2>"
+ print "<image src=\"" + fl[:-4] + ".jpg" + "\" width=\"600\" style=\"float: right;\" />"
+ print "<pre>"
+ for line in open(fl).readlines():
+ print line
+ print "</pre>"
+ print "<div style=\"clear: both;\"></div>"
+ print "</div>"
+
+print "</body>"
+print "</html>"
--- /dev/null
+#!/usr/bin/env python
+
+import sys
+import pickle
+
+res = pickle.load(open(sys.argv[1], 'r'))
+
+total = len(res)
+
+failed = [(name,error) for (name, time, output, error, r_code) in res
+ if r_code > 0]
+print "failed tests:", str(len(failed)) + '/' + str(total)
+
+for (name, error) in failed:
+ print " ", name
+
+print ""
+
+n = 0
+t = 0
+correct = 0
+
+for (name, time, output, error, r_code) in res:
+ if r_code > 0:
+ continue
+ n += 1
+ t += time
+ ref = open(name.split('.')[0] + '.txt').read()
+ if output == ref:
+ correct += 1
+ else:
+ #TODO find and record the error
+ pass
+
+print "average runtime:", (t/n)
+print "correct:", str(correct) + '/' + str(n)
--- /dev/null
+#!/usr/bin/env python
+
+import subprocess
+import pickle
+import time
+import datetime
+import sys
+
+proc = subprocess.Popen("ls *.jpg", shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+test_files = proc.communicate()[0].split()
+
+proc = subprocess.Popen("git log --pretty=format:'%h' -n 1", shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+
+git_hash = proc.communicate()[0].strip()
+
+res_name = "res" + datetime.datetime.now().strftime("%Y%m%d%H%M") + "-" + git_hash
+
+test_results = []
+n = 1
+
+for fl in test_files:
+ print "testing file", fl, str(n) + "/" + str(len(test_files))
+ n += 1
+ t0 = time.time()
+ proc = subprocess.Popen(["../imago", "-w", "640", fl],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ [output, err] = proc.communicate()
+ r_code = proc.returncode
+ t1 = time.time()
+ test_results.append((fl, t1 - t0, output, err, r_code))
+
+pickle.dump(test_results, open(res_name, 'w'))
+
+print "written file", res_name