diff options
| author | Dan Halbert <halbert@halwitz.org> | 2018-12-26 10:19:58 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-26 10:19:58 -0500 |
| commit | c8397b098e03e208ba49a0d525233707bce5d1db (patch) | |
| tree | 9d5f465d58905e3b30bed4eba8f25d05dbb78b4e | |
| parent | ca60a034c73aa85f3508c60bdcfcf0d9035c0027 (diff) | |
| parent | 5f3a259827a1c6d1e4292aa5a6198305e88abfef (diff) | |
Merge pull request #1417 from CarlFK/tinytest-t
Sync with micropython. closes #1414
| -rwxr-xr-x | tools/tinytest-codegen.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/tinytest-codegen.py b/tools/tinytest-codegen.py index 7f14db4ba..7a48f8a9a 100755 --- a/tools/tinytest-codegen.py +++ b/tools/tinytest-codegen.py @@ -23,7 +23,7 @@ def chew_filename(t): def script_to_map(test_file): r = {"name": chew_filename(test_file)["func"]} - with open(t) as test: + with open(test_file, "rb") as test: script = test.readlines() # Test for import skip_if and inject it into the test as needed. @@ -39,7 +39,11 @@ def script_to_map(test_file): continue script.insert(index + total_lines, "\t" + line) total_lines += 1 - r['script'] = escape(''.join(script)) + r['script'] = escape(b''.join(script)) + + with open(test_file + ".exp", "rb") as f: + r["output"] = escape(f.read()) + return r test_function = ( |
