diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-23 00:26:06 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-23 00:26:06 +0000 |
commit | 23261f3a526695eadffe541938278f0ecf93e9d6 (patch) | |
tree | 757ca6f160d421d4ca70d147d3262b0bf4e655d2 | |
parent | 965e2bafeabf1663f7d641bf5d16fa7f9116d822 (diff) | |
parent | fd232c3ef7d318f47b8d5a32366b96f7375fa407 (diff) | |
download | micropython-23261f3a526695eadffe541938278f0ecf93e9d6.tar.gz micropython-23261f3a526695eadffe541938278f0ecf93e9d6.zip |
Merge branch 'master' of github.com:micropython/micropython
-rwxr-xr-x | tests/run-tests | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/run-tests b/tests/run-tests index 76a8c5a109..259c18cd22 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -12,6 +12,10 @@ else: CPYTHON3 = 'python3.3' MP_PY = '../unix/micropython' +def rm_f(fname): + if os.path.exists(fname): + os.remove(fname) + test_count = 0 testcase_count = 0 passed_count = 0 @@ -30,14 +34,20 @@ for test_file in tests: try: output_mupy = subprocess.check_output([MP_PY, test_file]) except subprocess.CalledProcessError: - output_mupy = 'CRASH' + output_mupy = b'CRASH' testcase_count += len(output_expected.splitlines()) if output_expected == output_mupy: print("pass ", test_file) passed_count += 1 + rm_f(os.path.basename(test_file + ".exp")) + rm_f(os.path.basename(test_file + ".out")) else: + with open(os.path.basename(test_file + ".exp"), "w") as f: + f.write(str(output_expected, "ascii")) + with open(os.path.basename(test_file + ".out"), "w") as f: + f.write(str(output_mupy, "ascii")) print("FAIL ", test_file) failed_tests.append(test_name) |