1.1 --- a/test_all.py Mon Mar 21 01:25:11 2011 +0100
1.2 +++ b/test_all.py Mon Mar 21 01:27:27 2011 +0100
1.3 @@ -1,7 +1,5 @@
1.4 #!/usr/bin/env python
1.5
1.6 -import micropython.cmd
1.7 -import rsvp
1.8 import sys
1.9 import os
1.10 from glob import glob
1.11 @@ -24,33 +22,25 @@
1.12 try:
1.13 _f = args.index("-f")
1.14 filenames = args[_f+1:]
1.15 + args = args[:_f]
1.16 except ValueError:
1.17 filenames = glob(os.path.join("tests", "*.py"))
1.18
1.19 filenames.sort()
1.20
1.21 + # Make some arguments for the test program.
1.22 +
1.23 + args.append("-t")
1.24 + if "-tb" not in args:
1.25 + args.append("-exit")
1.26 +
1.27 results = []
1.28
1.29 for filename in filenames:
1.30 print "Processing", filename
1.31 -
1.32 - try:
1.33 - p = micropython.cmd.get_program(path, args)
1.34 - m = p.get_importer().load_from_file(filename)
1.35 -
1.36 - # Report any errors.
1.37 -
1.38 - except micropython.ProcessingError, exc:
1.39 - print repr(exc)
1.40 - if "-tb" in args:
1.41 - raise
1.42 - results.append((filename, 0))
1.43 -
1.44 - else:
1.45 - rm = rsvp.machine(p)
1.46 - success = rm.test(m)
1.47 - print "Test successful?", success and "Yes" or "No"
1.48 - results.append((filename, success))
1.49 + success = 0 == os.system("%s test.py %s %s" % (sys.executable, filename, " ".join(args)))
1.50 + print "Test successful?", success and "Yes" or "No"
1.51 + results.append((filename, success))
1.52
1.53 failed = [result[0] for result in results if not result[1]]
1.54 if failed: