diff options
Diffstat (limited to 'tests/run-tests')
-rwxr-xr-x | tests/run-tests | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/run-tests b/tests/run-tests index 9e837c3cb2..102655abea 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -25,6 +25,7 @@ def run_tests(pyb, tests): testcase_count = 0 passed_count = 0 failed_tests = [] + skipped_tests = [] running_under_travis = os.getenv('TRAVIS') == 'true' @@ -34,6 +35,7 @@ def run_tests(pyb, tests): for test_file in tests: if running_under_travis and test_file in skip_travis_tests: print("skip ", test_file) + skipped_tests.append(test_name) continue # get expected output @@ -42,8 +44,10 @@ def run_tests(pyb, tests): # expected output given by a file, so read that in with open(test_file_expected, 'rb') as f: output_expected = f.read() + if os.name == 'nt': + output_expected = output_expected.replace(b'\n', b'\r\n') else: - # run CPython to work out expeceted output + # run CPython to work out expected output try: output_expected = subprocess.check_output([CPYTHON3, '-B', test_file]) except subprocess.CalledProcessError: @@ -64,10 +68,16 @@ def run_tests(pyb, tests): except pyboard.PyboardError: output_mupy = b'CRASH' - testcase_count += len(output_expected.splitlines()) - test_basename = os.path.basename(test_file) test_name = os.path.splitext(test_basename)[0] + + if output_mupy == b'SKIP\n': + print("skip ", test_file) + skipped_tests.append(test_name) + continue + + testcase_count += len(output_expected.splitlines()) + filename_expected = test_basename + ".exp" filename_mupy = test_basename + ".out" @@ -89,6 +99,8 @@ def run_tests(pyb, tests): print("{} tests performed ({} individual testcases)".format(test_count, testcase_count)) print("{} tests passed".format(passed_count)) + if len(skipped_tests) > 0: + print("{} tests skipped: {}".format(len(skipped_tests), ' '.join(skipped_tests))) if len(failed_tests) > 0: print("{} tests failed: {}".format(len(failed_tests), ' '.join(failed_tests))) return False |