diff options
| author | Hendra Kusumah <h.kusumah87@gmail.com> | 2019-01-09 01:46:55 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-09 01:46:55 +0700 |
| commit | 025852c80548dacd60a73aa94eaa74dd8e09ea68 (patch) | |
| tree | a3c25f77d019270d4475ce509d7fbd2bba611a83 /tools/tinytest-codegen.py | |
| parent | 57c2c4134c52405b78e8d9cd8ed0ed05fefc2827 (diff) | |
| parent | 172311fad896fdb0780bdd6597b0b6d4d8bdadd3 (diff) | |
Merge pull request #1 from adafruit/master
update from original
Diffstat (limited to 'tools/tinytest-codegen.py')
| -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 = ( |
