Mercurial > web-gnusto
view run_tests.py @ 24:f45e9deb5323
Slightly better compression on z5_to_js_array.py.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 11 May 2008 19:06:23 -0700 |
parents | 4b6b9ea26552 |
children |
line wrap: on
line source
import glob import os import subprocess JS_CMD = "js" TESTS = glob.glob(os.path.join("tests", "*.js")) OUTPUT_FILE = "test_output.txt" def run_tests(): for test in TESTS: output = open(OUTPUT_FILE, "w") subprocess.call( [JS_CMD, test], stdout = output, stderr = subprocess.STDOUT ) output.close() expected_output_file = "tests/output/%s.txt" % ( os.path.splitext(os.path.basename(test))[0] ) lines = open(OUTPUT_FILE, "r").readlines() expected_lines = open(expected_output_file, "r").readlines() if lines != expected_lines: print 'Test "%s" failed.' % test else: print 'Test "%s" passed.' % test os.remove(OUTPUT_FILE) if __name__ == "__main__": run_tests()