summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-12-29 00:00:39 -0500
committerDan Halbert <halbert@halwitz.org>2018-12-29 00:00:39 -0500
commit145e1109150981a5735981bc5222985495bdde07 (patch)
tree8156b674e8286f7b1277ec8c25bd25595a1394ba /tools
parent4d1f0ec07be5e9cacaf0072a0f987871b8505ec4 (diff)
parent555da95cf5a29aa0439f80b5cbb5874f78bdcbdf (diff)
Merge remote-tracking branch 'adafruit/master' into bleio-rev
Diffstat (limited to 'tools')
-rwxr-xr-xtools/tinytest-codegen.py8
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 = (