# HG changeset patch # User Paul Boddie # Date 1300667247 -3600 # Node ID fd96865ebfb70e5cfd2d5d41d04dda16e52cb122 # Parent 7696283f65991c705dfd728cca7b1340211ba7fe Changed the test runner to support separate-process invocation of the test program, since running all tests in the same process appears to cause substantial memory usage as if memory is not being freed, even when garbage collection is explicitly requested. diff -r 7696283f6599 -r fd96865ebfb7 test.py --- a/test.py Mon Mar 21 01:25:11 2011 +0100 +++ b/test.py Mon Mar 21 01:27:27 2011 +0100 @@ -95,5 +95,7 @@ print repr(exc) if "-tb" in args: raise + elif "-exit" in args: + sys.exit(1) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 7696283f6599 -r fd96865ebfb7 test_all.py --- a/test_all.py Mon Mar 21 01:25:11 2011 +0100 +++ b/test_all.py Mon Mar 21 01:27:27 2011 +0100 @@ -1,7 +1,5 @@ #!/usr/bin/env python -import micropython.cmd -import rsvp import sys import os from glob import glob @@ -24,33 +22,25 @@ try: _f = args.index("-f") filenames = args[_f+1:] + args = args[:_f] except ValueError: filenames = glob(os.path.join("tests", "*.py")) filenames.sort() + # Make some arguments for the test program. + + args.append("-t") + if "-tb" not in args: + args.append("-exit") + results = [] for filename in filenames: print "Processing", filename - - try: - p = micropython.cmd.get_program(path, args) - m = p.get_importer().load_from_file(filename) - - # Report any errors. - - except micropython.ProcessingError, exc: - print repr(exc) - if "-tb" in args: - raise - results.append((filename, 0)) - - else: - rm = rsvp.machine(p) - success = rm.test(m) - print "Test successful?", success and "Yes" or "No" - results.append((filename, success)) + success = 0 == os.system("%s test.py %s %s" % (sys.executable, filename, " ".join(args))) + print "Test successful?", success and "Yes" or "No" + results.append((filename, success)) failed = [result[0] for result in results if not result[1]] if failed: