1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

fix minor issues in test runner scripts on device (#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
This commit is contained in:
david gauchard 2018-03-21 17:07:23 +01:00 committed by GitHub
parent 6580bf3477
commit 2013af1b19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -11,10 +11,10 @@ clean:
$(PYTHON_ENV_DIR):
virtualenv --no-site-packages $(PYTHON_ENV_DIR)
source $(PYTHON_ENV_DIR)/bin/activate && pip install -r requirements.txt
. $(PYTHON_ENV_DIR)/bin/activate && pip install -r requirements.txt
test: $(TEST_EXECUTABLE) $(PYTHON_ENV_DIR)
source $(PYTHON_ENV_DIR)/bin/activate && python runner.py -e $(TEST_EXECUTABLE)
. $(PYTHON_ENV_DIR)/bin/activate && python runner.py -e $(TEST_EXECUTABLE)
$(TEST_EXECUTABLE): test/test.cpp
g++ -std=c++11 -Isrc -o $@ test/test.cpp

View File

@ -32,6 +32,7 @@ class BSTestRunner(object):
FAIL = 1
TIMEOUT = 2
CRASH = 3
BEGINTIMEOUT = 4
def __init__(self, spawn_obj, name, mocks):
self.sp = spawn_obj
@ -116,7 +117,7 @@ class BSTestRunner(object):
time.sleep(0.1)
timeout -= 0.1
if timeout <= 0:
raise 'test begin timeout'
return BSTestRunner.BEGINTIMEOUT
while timeout > 0:
res = self.sp.expect([r'>>>>>bs_test_check_failure line=(\d+)',
r'>>>>>bs_test_end line=(\d+) result=(\d+) checks=(\d+) failed_checks=(\d+)',