summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lechner <david@pybricks.com>2020-01-02 09:40:54 -0600
committerDamien George <damien.p.george@gmail.com>2020-01-06 22:22:27 +1100
commit1bc9fc80821edea293bc04a4c1c2c462dc546813 (patch)
treebf5c0ff78c3a1c405e7720cc7abcfdee3537af0f
parentaec88ddf0326187c567d4e4507149fb7c54ba91d (diff)
tests/run-tests: Handle 'CRASH' return by float.py feature test.
It is possile for `run_feature_check(pyb, args, base_path, 'float.py')` to return `b'CRASH'`. This causes an unhandled exception in `int()`. This commit fixes the problem by first testing for `b'CRASH'` before trying to convert the return value to an integer.
-rwxr-xr-xtests/run-tests6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/run-tests b/tests/run-tests
index 789a6f06c..b02463dc3 100755
--- a/tests/run-tests
+++ b/tests/run-tests
@@ -288,7 +288,11 @@ def run_tests(pyb, tests, args, base_path="."):
skip_tests.add('cmdline/repl_emacs_keys.py')
upy_byteorder = run_feature_check(pyb, args, base_path, 'byteorder.py')
- upy_float_precision = int(run_feature_check(pyb, args, base_path, 'float.py'))
+ upy_float_precision = run_feature_check(pyb, args, base_path, 'float.py')
+ if upy_float_precision == b'CRASH':
+ upy_float_precision = 0
+ else:
+ upy_float_precision = int(upy_float_precision)
has_complex = run_feature_check(pyb, args, base_path, 'complex.py') == b'complex\n'
has_coverage = run_feature_check(pyb, args, base_path, 'coverage.py') == b'coverage\n'
cpy_byteorder = subprocess.check_output([CPYTHON3, base_path + '/feature_check/byteorder.py'])