Skip to content

Commit 2013af1

Browse files
authored
fix minor issues in test runner scripts on device (esp8266#4542)
* tests/device/Makefile: use bourne shell compatible "." instead ot "source" (ubuntu's dash does not understand it) * tests/device: make BEGINTIMEOUT a new error return value instead of a test-process-breaking exception
1 parent 6580bf3 commit 2013af1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/device/libraries/BSTest/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ clean:
1111

1212
$(PYTHON_ENV_DIR):
1313
virtualenv --no-site-packages $(PYTHON_ENV_DIR)
14-
source $(PYTHON_ENV_DIR)/bin/activate && pip install -r requirements.txt
14+
. $(PYTHON_ENV_DIR)/bin/activate && pip install -r requirements.txt
1515

1616
test: $(TEST_EXECUTABLE) $(PYTHON_ENV_DIR)
17-
source $(PYTHON_ENV_DIR)/bin/activate && python runner.py -e $(TEST_EXECUTABLE)
17+
. $(PYTHON_ENV_DIR)/bin/activate && python runner.py -e $(TEST_EXECUTABLE)
1818

1919
$(TEST_EXECUTABLE): test/test.cpp
2020
g++ -std=c++11 -Isrc -o $@ test/test.cpp

tests/device/libraries/BSTest/runner.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class BSTestRunner(object):
3232
FAIL = 1
3333
TIMEOUT = 2
3434
CRASH = 3
35+
BEGINTIMEOUT = 4
3536

3637
def __init__(self, spawn_obj, name, mocks):
3738
self.sp = spawn_obj
@@ -116,7 +117,7 @@ def run_test(self, index):
116117
time.sleep(0.1)
117118
timeout -= 0.1
118119
if timeout <= 0:
119-
raise 'test begin timeout'
120+
return BSTestRunner.BEGINTIMEOUT
120121
while timeout > 0:
121122
res = self.sp.expect([r'>>>>>bs_test_check_failure line=(\d+)',
122123
r'>>>>>bs_test_end line=(\d+) result=(\d+) checks=(\d+) failed_checks=(\d+)',

0 commit comments

Comments
 (0)