Skip to content

Commit 7c184f4

Browse files
d-a-vearlephilhower
authored andcommitted
filter weird characters from esp output to python (#6226)
(this is an issue probably since we switched from esptool.exe to esptool.py)
1 parent 80e976d commit 7c184f4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

tests/device/Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ all: count tests test_report
3434

3535
$(TEST_LIST): | virtualenv $(TEST_CONFIG) $(BUILD_DIR) $(HARDWARE_DIR)
3636

37-
tests: $(TEST_LIST)
37+
tests: showtestlist $(TEST_LIST)
38+
39+
showtestlist:
40+
@echo "-------------------------------- test list:"
41+
@echo $(TEST_LIST)
42+
@echo "--------------------------------"
3843

3944
$(TEST_LIST): LOCAL_BUILD_DIR=$(BUILD_DIR)/$(notdir $@)
4045

4146
$(TEST_LIST):
42-
@echo Running $(words $(TEST_LIST)) tests
47+
@echo "--------------------------------"
48+
@echo "Running test '$@' of $(words $(TEST_LIST)) tests"
4349
$(SILENT)mkdir -p $(LOCAL_BUILD_DIR)
4450
ifneq ("$(NO_BUILD)","1")
4551
@test -n "$(ARDUINO_IDE_PATH)" || (echo "Please export ARDUINO_IDE_PATH" && exit 1)
@@ -85,7 +91,7 @@ ifneq ("$(NO_RUN)","1")
8591
--port $(UPLOAD_PORT) \
8692
--baud $(UPLOAD_BAUD) \
8793
read_flash_status # reset
88-
@source $(BS_DIR)/virtualenv/bin/activate && \
94+
$(SILENT)source $(BS_DIR)/virtualenv/bin/activate && \
8995
$(PYTHON) $(BS_DIR)/runner.py \
9096
$(RUNNER_DEBUG_FLAG) \
9197
-p $(UPLOAD_PORT) \

tests/device/libraries/BSTest/runner.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import mock_decorators
3030

3131
debug = False
32+
#debug = True
3233

3334
sys.path.append(os.path.abspath(__file__))
3435

@@ -126,7 +127,7 @@ def run_tests(self):
126127
debug_print('test output was:')
127128
debug_print(test_output.getvalue())
128129
if result == BSTestRunner.SUCCESS:
129-
test_case.stdout = test_output.getvalue()
130+
test_case.stdout = filter(lambda c: ord(c) < 128, test_output.getvalue())
130131
print('test "{}" passed'.format(name))
131132
else:
132133
print('test "{}" failed'.format(name))
@@ -269,7 +270,7 @@ def main():
269270
ts = run_tests(sp, name, mocks, env_vars)
270271
if args.output:
271272
with open(args.output, "w") as f:
272-
TestSuite.to_file(f, [ts])
273+
TestSuite.to_file(f, [ts], encoding='raw_unicode_escape')
273274
return 0
274275

275276
if __name__ == '__main__':

0 commit comments

Comments
 (0)