diff options
author | stijn <stijn@ignitron.net> | 2015-03-24 11:55:26 +0100 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-02-14 20:19:00 +0300 |
commit | c6fd9ba4f371dc8f2ec5e1859587fafa15bef9d0 (patch) | |
tree | 20adb0708f16affb637e44f887dab94698fc5761 /tests | |
parent | ce2703599f844b73f3eab10b96197a01bc01ccf2 (diff) | |
download | micropython-c6fd9ba4f371dc8f2ec5e1859587fafa15bef9d0.tar.gz micropython-c6fd9ba4f371dc8f2ec5e1859587fafa15bef9d0.zip |
tests: Add option to not clear MICROPYPATH when running tests
This allows using the test runner for other scenarios than just
testing uPy itself.
The principle of comparing either to CPython or else to a .exp
file is really handy but to be able to test custom modules not
built into micropython.exe one needs to be able to specify the
module search path a.k.a MICROPYPATH.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/run-tests | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/run-tests b/tests/run-tests index c74d0f24b4..24599ed64e 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -23,7 +23,6 @@ MPYCROSS = os.getenv('MICROPY_MPYCROSS', '../mpy-cross/mpy-cross') # Set PYTHONIOENCODING so that CPython will use utf-8 on systems which set another encoding in the locale os.environ['PYTHONIOENCODING'] = 'utf-8' -os.environ['MICROPYPATH'] = '' def rm_f(fname): if os.path.exists(fname): @@ -400,6 +399,7 @@ def main(): cmd_parser.add_argument('--emit', default='bytecode', help='MicroPython emitter to use (bytecode or native)') cmd_parser.add_argument('--heapsize', help='heapsize to use (use default if not specified)') cmd_parser.add_argument('--via-mpy', action='store_true', help='compile .py files to .mpy first') + cmd_parser.add_argument('--keep-path', action='store_true', help='do not clear MICROPYPATH when running tests') cmd_parser.add_argument('files', nargs='*', help='input test files') args = cmd_parser.parse_args() @@ -434,6 +434,10 @@ def main(): # tests explicitly given tests = args.files + if not args.keep_path: + # clear search path to make sure tests use only builtin modules + os.environ['MICROPYPATH'] = '' + if not run_tests(pyb, tests, args): sys.exit(1) |