From c297ca33276275645f13b20994b7d445e7b272db Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Wed, 16 Apr 2014 20:24:16 +0100 Subject: [PATCH 1/3] Allow the uPy used by run-tests to be overridden with MICROPY_MP_PY envvar, in an analogous way to MICROPY_CPYTHON3 envvar. (the reason for this will be made clearer by a later PR) --- tests/run-tests | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/run-tests b/tests/run-tests index bd6e50bbd2..49be9dae2b 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -10,10 +10,10 @@ from glob import glob # to the correct executable. if os.name == 'nt': CPYTHON3 = os.getenv('MICROPY_CPYTHON3', 'python3.exe') - MP_PY = '../windows/micropython.exe' + MP_PY = os.getenv('MICROPY_MP_PY', '../windows/micropython.exe') else: CPYTHON3 = os.getenv('MICROPY_CPYTHON3', 'python3') - MP_PY = '../unix/micropython' + MP_PY = ('MICROPY_MP_PY', '../unix/micropython') # Set of tests that we shouldn't run under Travis CI skip_travis_tests = set(['basics/memoryerror.py']) @@ -39,7 +39,7 @@ if test_on_pyboard: pyb = pyboard.Pyboard('/dev/ttyACM0') pyb.enter_raw_repl() -running_under_travis = os.environ.get('TRAVIS', 'false') == 'true' +running_under_travis = os.getenv('TRAVIS') == 'true' for test_file in tests: if running_under_travis and test_file in skip_travis_tests: From 6ca17bcfb6a719a625ed76f0354bed7ed014d136 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Wed, 16 Apr 2014 21:17:28 +0100 Subject: [PATCH 2/3] Stupid typo --- tests/run-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run-tests b/tests/run-tests index 49be9dae2b..52fdd11b25 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -13,7 +13,7 @@ if os.name == 'nt': MP_PY = os.getenv('MICROPY_MP_PY', '../windows/micropython.exe') else: CPYTHON3 = os.getenv('MICROPY_CPYTHON3', 'python3') - MP_PY = ('MICROPY_MP_PY', '../unix/micropython') + MP_PY = os.getenv('MICROPY_MP_PY', '../unix/micropython') # Set of tests that we shouldn't run under Travis CI skip_travis_tests = set(['basics/memoryerror.py']) From 5709453ca7b03a2decb67acb64cdb3e0a788e9fb Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Thu, 17 Apr 2014 01:22:45 +0100 Subject: [PATCH 3/3] Changed the envvar name to MICROPY_MICROPYTHON As discussed in #504 --- tests/run-tests | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/run-tests b/tests/run-tests index 52fdd11b25..cfc0fdee89 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -10,10 +10,10 @@ from glob import glob # to the correct executable. if os.name == 'nt': CPYTHON3 = os.getenv('MICROPY_CPYTHON3', 'python3.exe') - MP_PY = os.getenv('MICROPY_MP_PY', '../windows/micropython.exe') + MICROPYTHON = os.getenv('MICROPY_MICROPYTHON', '../windows/micropython.exe') else: CPYTHON3 = os.getenv('MICROPY_CPYTHON3', 'python3') - MP_PY = os.getenv('MICROPY_MP_PY', '../unix/micropython') + MICROPYTHON = os.getenv('MICROPY_MICROPYTHON', '../unix/micropython') # Set of tests that we shouldn't run under Travis CI skip_travis_tests = set(['basics/memoryerror.py']) @@ -65,7 +65,7 @@ for test_file in tests: output_mupy = b'CRASH\n' + output_mupy else: try: - output_mupy = subprocess.check_output([MP_PY, '-X', 'emit=bytecode', test_file]) + output_mupy = subprocess.check_output([MICROPYTHON, '-X', 'emit=bytecode', test_file]) except subprocess.CalledProcessError: output_mupy = b'CRASH'