Mercurial > web-gnusto
view run_tests.py @ 63:605a0060e5a7
Replaced the burin() calls in gnusto-engine with a new logger function.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Fri, 16 May 2008 15:53:14 -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()