From 149105f39110513f4f29d02fb00479a9855098ce Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 11:04:15 +0300 Subject: [PATCH 01/12] add more begin timeout for networked sketches and actually fail if begin is not received --- tests/device/libraries/BSTest/runner.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/device/libraries/BSTest/runner.py b/tests/device/libraries/BSTest/runner.py index 92d8b90082..64cd42785a 100644 --- a/tests/device/libraries/BSTest/runner.py +++ b/tests/device/libraries/BSTest/runner.py @@ -42,15 +42,18 @@ def __init__(self, spawn_obj, name, mocks): def get_test_list(self): self.sp.sendline('-1') - timeout = 10 + self.tests = [] + timeout = 100 while timeout > 0: res = self.sp.expect(['>>>>>bs_test_menu_begin', EOF, TIMEOUT]) if res == 0: break timeout-=1 time.sleep(0.1) + if timeout <= 0: + debug_print('begin timeout') + return debug_print('got begin') - self.tests = [] while True: res = self.sp.expect(['>>>>>bs_test_item id\=(\d+) name\="([^\"]*?)" desc="([^"]*?)"', '>>>>>bs_test_menu_end', From d8370dd6af5c4667049c070e86f9b4b339ee205b Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 18:54:01 +0300 Subject: [PATCH 02/12] Initial WebServer Test --- .../test_http_server/test_http_server.ino | 129 ++++++++++++++++++ .../test_http_server/test_http_server.py | 73 ++++++++++ 2 files changed, 202 insertions(+) create mode 100644 tests/device/test_http_server/test_http_server.ino create mode 100644 tests/device/test_http_server/test_http_server.py diff --git a/tests/device/test_http_server/test_http_server.ino b/tests/device/test_http_server/test_http_server.ino new file mode 100644 index 0000000000..92601b02f2 --- /dev/null +++ b/tests/device/test_http_server/test_http_server.ino @@ -0,0 +1,129 @@ +#include +#include +#include +#include +#include +#include +#include + +BS_ENV_DECLARE(); + +static ESP8266WebServer server(80); +static uint32_t siteHits = 0; +static String siteData = ""; + +void setup() +{ + Serial.begin(115200); + Serial.setDebugOutput(true); + WiFi.persistent(false); + WiFi.begin(STA_SSID, STA_PASS); + while (WiFi.status() != WL_CONNECTED) { + delay(500); + } + MDNS.begin("etd"); + server.onNotFound([](){ server.send(404); }); + server.begin(); + BS_RUN(Serial); +} + + +TEST_CASE("HTTP GET Parameters", "[HTTPServer]") +{ + { + siteHits = 0; + server.on("/get", HTTP_GET, [](){ + siteData = ""; + for (uint8_t i=0; i 0) + siteData += "&"; + siteData += server.argName(i) + "=" + server.arg(i); + } + siteHits++; + server.send(200, "text/plain", siteData); + }); + uint32_t startTime = millis(); + while(siteHits == 0 && (millis() - startTime) < 10000) + server.handleClient(); + Serial.printf("Test 1: hits: %u, data: %s\n", siteHits, siteData.c_str()); + REQUIRE(siteHits > 0 && siteData.equals("var1=val with spaces&var+=some%")); + } +} + +TEST_CASE("HTTP POST Parameters", "[HTTPServer]") +{ + { + siteHits = 0; + server.on("/post", HTTP_POST, [](){ + siteData = ""; + for (uint8_t i=0; i 0) + siteData += "&"; + siteData += server.argName(i) + "=" + server.arg(i); + } + siteHits++; + server.send(200, "text/plain", siteData); + }); + uint32_t startTime = millis(); + while(siteHits == 0 && (millis() - startTime) < 10000) + server.handleClient(); + Serial.printf("Test 2: hits: %u, data: %s\n", siteHits, siteData.c_str()); + REQUIRE(siteHits > 0 && siteData.equals("var2=val with spaces")); + } +} + +TEST_CASE("HTTP GET+POST Parameters", "[HTTPServer]") +{ + { + siteHits = 0; + server.on("/get_and_post", HTTP_POST, [](){ + siteData = ""; + for (uint8_t i=0; i 0) + siteData += "&"; + siteData += server.argName(i) + "=" + server.arg(i); + } + siteHits++; + server.send(200, "text/plain", siteData); + }); + uint32_t startTime = millis(); + while(siteHits == 0 && (millis() - startTime) < 10000) + server.handleClient(); + Serial.printf("Test 3: hits: %u, data: %s\n", siteHits, siteData.c_str()); + REQUIRE(siteHits > 0 && siteData.equals("var3=val with spaces&var+=some%")); + } +} + +TEST_CASE("HTTP Upload", "[HTTPServer]") +{ + { + siteHits = 0; + server.on("/upload", HTTP_POST, [](){ + for (uint8_t i=0; i 0) + siteData += "&"; + siteData += server.argName(i) + "=" + server.arg(i); + } + siteHits++; + server.send(200, "text/plain", siteData); + }, [](){ + HTTPUpload& upload = server.upload(); + if(upload.status == UPLOAD_FILE_START){ + siteData = upload.filename; + } else if(upload.status == UPLOAD_FILE_END){ + siteData.concat(":"); + siteData.concat(String(upload.totalSize)); + siteData.concat("&"); + } + }); + uint32_t startTime = millis(); + while(siteHits == 0 && (millis() - startTime) < 10000) + server.handleClient(); + Serial.printf("Test 4: hits: %u, data: %s\n", siteHits, siteData.c_str()); + REQUIRE(siteHits > 0 && siteData.equals("test.txt:16&var4=val with spaces")); + } +} + +void loop() +{ +} diff --git a/tests/device/test_http_server/test_http_server.py b/tests/device/test_http_server/test_http_server.py new file mode 100644 index 0000000000..c43b2b251a --- /dev/null +++ b/tests/device/test_http_server/test_http_server.py @@ -0,0 +1,73 @@ +from mock_decorators import setup, teardown +from threading import Thread +from poster.encode import MultipartParam +from poster.encode import multipart_encode +from poster.streaminghttp import register_openers +import urllib2 +import urllib + +def http_test(res, url, get=None, post=None): + response = '' + try: + if get: + url += '?' + urllib.urlencode(get) + if post: + post = urllib.urlencode(post) + request = urllib2.urlopen(url, post, 2) + response = request.read() + except: + return 1 + if response != res: + return 1 + return 0 + +@setup('HTTP GET Parameters') +def setup_http_get_params(e): + def testRun(): + return http_test('var1=val with spaces&var+=some%', 'http://etd.local/get', {'var1' : 'val with spaces', 'var+' : 'some%'}) + Thread(target=testRun).start() + +@teardown('HTTP GET Parameters') +def teardown_http_get_params(e): + return 0 + +@setup('HTTP POST Parameters') +def setup_http_post_params(e): + def testRun(): + return http_test('var2=val with spaces', 'http://etd.local/post', None, {'var2' : 'val with spaces'}) + Thread(target=testRun).start() + +@teardown('HTTP POST Parameters') +def teardown_http_post_params(e): + return 0 + +@setup('HTTP GET+POST Parameters') +def setup_http_getpost_params(e): + def testRun(): + return http_test('var3=val with spaces&var+=some%', 'http://etd.local/get_and_post', {'var3' : 'val with spaces'}, {'var+' : 'some%'}) + Thread(target=testRun).start() + +@teardown('HTTP GET+POST Parameters') +def teardown_http_getpost_params(e): + return 0 + +@setup('HTTP Upload') +def setup_http_upload(e): + def testRun(): + response = '' + try: + register_openers() + p = MultipartParam("file", "0123456789abcdef", "test.txt", "text/plain; charset=utf8") + datagen, headers = multipart_encode( [("var4", "val with spaces"), p] ) + request = urllib2.Request('http://etd.local/upload', datagen, headers) + response = urllib2.urlopen(request, None, 2).read() + except: + return 1 + if response != 'test.txt:16&var4=val with spaces': + return 1 + return 0 + Thread(target=testRun).start() + +@teardown('HTTP Upload') +def teardown_http_upload(e): + return 0 From 032cd52985b7ff3b9daefa01356c66fe6dd5e2de Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 19:13:40 +0300 Subject: [PATCH 03/12] remove debug from test --- tests/device/test_http_server/test_http_server.ino | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/device/test_http_server/test_http_server.ino b/tests/device/test_http_server/test_http_server.ino index 92601b02f2..9b5fe43eea 100644 --- a/tests/device/test_http_server/test_http_server.ino +++ b/tests/device/test_http_server/test_http_server.ino @@ -45,7 +45,6 @@ TEST_CASE("HTTP GET Parameters", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); - Serial.printf("Test 1: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("var1=val with spaces&var+=some%")); } } @@ -67,7 +66,6 @@ TEST_CASE("HTTP POST Parameters", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); - Serial.printf("Test 2: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("var2=val with spaces")); } } @@ -89,7 +87,6 @@ TEST_CASE("HTTP GET+POST Parameters", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); - Serial.printf("Test 3: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("var3=val with spaces&var+=some%")); } } @@ -119,7 +116,6 @@ TEST_CASE("HTTP Upload", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); - Serial.printf("Test 4: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("test.txt:16&var4=val with spaces")); } } From d2d7c6247d4379e91e70b71dae3aae22223f2905 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 19:32:57 +0300 Subject: [PATCH 04/12] Add debug again Testing Jenkins Git Hooks --- tests/device/test_http_server/test_http_server.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/device/test_http_server/test_http_server.ino b/tests/device/test_http_server/test_http_server.ino index 9b5fe43eea..92601b02f2 100644 --- a/tests/device/test_http_server/test_http_server.ino +++ b/tests/device/test_http_server/test_http_server.ino @@ -45,6 +45,7 @@ TEST_CASE("HTTP GET Parameters", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); + Serial.printf("Test 1: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("var1=val with spaces&var+=some%")); } } @@ -66,6 +67,7 @@ TEST_CASE("HTTP POST Parameters", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); + Serial.printf("Test 2: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("var2=val with spaces")); } } @@ -87,6 +89,7 @@ TEST_CASE("HTTP GET+POST Parameters", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); + Serial.printf("Test 3: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("var3=val with spaces&var+=some%")); } } @@ -116,6 +119,7 @@ TEST_CASE("HTTP Upload", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); + Serial.printf("Test 4: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("test.txt:16&var4=val with spaces")); } } From c002a32121b09f523e7046b468b40db77bf6cea4 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 20:21:52 +0300 Subject: [PATCH 05/12] Attempt to wake up Jenkins again --- tests/device/test_http_server/test_http_server.ino | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/device/test_http_server/test_http_server.ino b/tests/device/test_http_server/test_http_server.ino index 92601b02f2..9b5fe43eea 100644 --- a/tests/device/test_http_server/test_http_server.ino +++ b/tests/device/test_http_server/test_http_server.ino @@ -45,7 +45,6 @@ TEST_CASE("HTTP GET Parameters", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); - Serial.printf("Test 1: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("var1=val with spaces&var+=some%")); } } @@ -67,7 +66,6 @@ TEST_CASE("HTTP POST Parameters", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); - Serial.printf("Test 2: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("var2=val with spaces")); } } @@ -89,7 +87,6 @@ TEST_CASE("HTTP GET+POST Parameters", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); - Serial.printf("Test 3: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("var3=val with spaces&var+=some%")); } } @@ -119,7 +116,6 @@ TEST_CASE("HTTP Upload", "[HTTPServer]") uint32_t startTime = millis(); while(siteHits == 0 && (millis() - startTime) < 10000) server.handleClient(); - Serial.printf("Test 4: hits: %u, data: %s\n", siteHits, siteData.c_str()); REQUIRE(siteHits > 0 && siteData.equals("test.txt:16&var4=val with spaces")); } } From 01434e0a4be918e0c5263e79addb6740ba4f8f66 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 20:34:20 +0300 Subject: [PATCH 06/12] no go jenkins --- tests/device/test_http_server/test_http_server.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/device/test_http_server/test_http_server.ino b/tests/device/test_http_server/test_http_server.ino index 9b5fe43eea..d1a9fa9c81 100644 --- a/tests/device/test_http_server/test_http_server.ino +++ b/tests/device/test_http_server/test_http_server.ino @@ -12,6 +12,7 @@ static ESP8266WebServer server(80); static uint32_t siteHits = 0; static String siteData = ""; + void setup() { Serial.begin(115200); From b0fc097627949c0eaf0ce05e7235466b3c3f3fd2 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 20:40:55 +0300 Subject: [PATCH 07/12] Test Commit Message Jenkins! --- tests/device/test_http_server/test_http_server.ino | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/device/test_http_server/test_http_server.ino b/tests/device/test_http_server/test_http_server.ino index d1a9fa9c81..9b5fe43eea 100644 --- a/tests/device/test_http_server/test_http_server.ino +++ b/tests/device/test_http_server/test_http_server.ino @@ -12,7 +12,6 @@ static ESP8266WebServer server(80); static uint32_t siteHits = 0; static String siteData = ""; - void setup() { Serial.begin(115200); From 9d0904749544ded5d2a546ea595e681e9c206509 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 21:10:16 +0300 Subject: [PATCH 08/12] ignore .pyc files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b1b0b534ea..c36bdd3aa3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ exclude.txt tools/sdk/lib/liblwip_src.a tools/sdk/lwip/src/build tools/sdk/lwip/src/liblwip_src.a + +*.pyc From 33b48d90bce2bd083b7e12b7126075ffe8dc3c35 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 22:04:23 +0300 Subject: [PATCH 09/12] test quotes for paths --- tests/device/Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/device/Makefile b/tests/device/Makefile index e779996c7a..ac2c8a4761 100644 --- a/tests/device/Makefile +++ b/tests/device/Makefile @@ -49,10 +49,10 @@ ifneq ("$(NO_BUILD)","1") -core-api-version="10608" \ -warnings=none \ $(BUILDER_DEBUG_FLAG) \ - -build-path $(LOCAL_BUILD_DIR) \ - -tools $(ARDUINO_IDE_PATH)/tools-builder \ - -hardware $(HARDWARE_DIR)\ - -hardware $(ARDUINO_IDE_PATH)/hardware \ + -build-path "$(LOCAL_BUILD_DIR)" \ + -tools "$(ARDUINO_IDE_PATH)/tools-builder" \ + -hardware "$(HARDWARE_DIR)"\ + -hardware "$(ARDUINO_IDE_PATH)/hardware" \ -fqbn=$(FQBN) \ $@ endif @@ -61,17 +61,17 @@ ifneq ("$(NO_UPLOAD)","1") -cp $(UPLOAD_PORT) \ -cb $(UPLOAD_BAUD) \ -cd $(UPLOAD_BOARD) \ - -cf $(LOCAL_BUILD_DIR)/$(notdir $@).bin + -cf "$(LOCAL_BUILD_DIR)/$(notdir $@).bin" endif ifneq ("$(NO_RUN)","1") @echo Running tests $(SILENT)$(ESPTOOL) $(UPLOAD_VERBOSE_FLAG) -cp $(UPLOAD_PORT) -cd $(UPLOAD_BOARD) -cr - @source $(BS_DIR)/virtualenv/bin/activate && \ - python $(BS_DIR)/runner.py \ + @source "$(BS_DIR)/virtualenv/bin/activate" && \ + python "$(BS_DIR)/runner.py" \ $(RUNNER_DEBUG_FLAG) \ -p $(UPLOAD_PORT) \ - -n $(basename $(notdir $@)) \ - -o $(LOCAL_BUILD_DIR)/test_result.xml \ + -n "$(basename $(notdir $@))" \ + -o "$(LOCAL_BUILD_DIR)/test_result.xml" \ `test -f $(addsuffix .py, $(basename $@)) && echo "-m $(addsuffix .py, $(basename $@))" || echo ""` endif @@ -96,4 +96,4 @@ $(TEST_CONFIG): @echo "****** " false -.PHONY: tests all count venv $(BUILD_DIR) $(TEST_LIST) +.PHONY: tests all count venv $(BUILD_DIR) $(TEST_LIST) From e85de59bd871df8720343fb1bb78caf8e9e7e70f Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 22:13:11 +0300 Subject: [PATCH 10/12] more makefile quoting --- tests/device/Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/device/Makefile b/tests/device/Makefile index ac2c8a4761..fb29392671 100644 --- a/tests/device/Makefile +++ b/tests/device/Makefile @@ -36,9 +36,9 @@ all: count tests count: @echo Running $(words $(TEST_LIST)) tests -tests: $(BUILD_DIR) $(HARDWARE_DIR) virtualenv $(TEST_CONFIG) $(TEST_LIST) +tests: "$(BUILD_DIR)" "$(HARDWARE_DIR)" virtualenv $(TEST_CONFIG) $(TEST_LIST) -$(TEST_LIST): LOCAL_BUILD_DIR=$(BUILD_DIR)/$(notdir $@) +$(TEST_LIST): LOCAL_BUILD_DIR="$(BUILD_DIR)/$(notdir $@)" $(TEST_LIST): $(SILENT)mkdir -p $(LOCAL_BUILD_DIR) @@ -49,7 +49,7 @@ ifneq ("$(NO_BUILD)","1") -core-api-version="10608" \ -warnings=none \ $(BUILDER_DEBUG_FLAG) \ - -build-path "$(LOCAL_BUILD_DIR)" \ + -build-path $(LOCAL_BUILD_DIR) \ -tools "$(ARDUINO_IDE_PATH)/tools-builder" \ -hardware "$(HARDWARE_DIR)"\ -hardware "$(ARDUINO_IDE_PATH)/hardware" \ @@ -76,18 +76,18 @@ ifneq ("$(NO_RUN)","1") endif $(BUILD_DIR): - mkdir -p $(BUILD_DIR) + mkdir -p "$(BUILD_DIR)" $(HARDWARE_DIR): - mkdir -p $(HARDWARE_DIR)/esp8266com - cd $(HARDWARE_DIR)/esp8266com && ln -s $(realpath $(ESP8266_CORE_PATH)) esp8266 + mkdir -p "$(HARDWARE_DIR)/esp8266com" + cd "$(HARDWARE_DIR)/esp8266com" && ln -s "$(realpath $(ESP8266_CORE_PATH))" esp8266 virtualenv: - make -C $(BS_DIR) virtualenv + make -C "$(BS_DIR)" virtualenv clean: - rm -rf $(BUILD_DIR) - rm -rf $(HARDWARE_DIR) + rm -rf "$(BUILD_DIR)" + rm -rf "$(HARDWARE_DIR)" $(TEST_CONFIG): @echo "****** " @@ -96,4 +96,4 @@ $(TEST_CONFIG): @echo "****** " false -.PHONY: tests all count venv $(BUILD_DIR) $(TEST_LIST) +.PHONY: tests all count venv "$(BUILD_DIR)" $(TEST_LIST) From 7cf0051b5860ec132675cda59efa57c260f90bfa Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 22:18:18 +0300 Subject: [PATCH 11/12] revert makefile changes --- tests/device/Makefile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/device/Makefile b/tests/device/Makefile index fb29392671..cf7810fcda 100644 --- a/tests/device/Makefile +++ b/tests/device/Makefile @@ -36,9 +36,9 @@ all: count tests count: @echo Running $(words $(TEST_LIST)) tests -tests: "$(BUILD_DIR)" "$(HARDWARE_DIR)" virtualenv $(TEST_CONFIG) $(TEST_LIST) +tests: $(BUILD_DIR) $(HARDWARE_DIR) virtualenv $(TEST_CONFIG) $(TEST_LIST) -$(TEST_LIST): LOCAL_BUILD_DIR="$(BUILD_DIR)/$(notdir $@)" +$(TEST_LIST): LOCAL_BUILD_DIR=$(BUILD_DIR)/$(notdir $@) $(TEST_LIST): $(SILENT)mkdir -p $(LOCAL_BUILD_DIR) @@ -50,9 +50,9 @@ ifneq ("$(NO_BUILD)","1") -warnings=none \ $(BUILDER_DEBUG_FLAG) \ -build-path $(LOCAL_BUILD_DIR) \ - -tools "$(ARDUINO_IDE_PATH)/tools-builder" \ - -hardware "$(HARDWARE_DIR)"\ - -hardware "$(ARDUINO_IDE_PATH)/hardware" \ + -tools $(ARDUINO_IDE_PATH)/tools-builder \ + -hardware $(HARDWARE_DIR)\ + -hardware $(ARDUINO_IDE_PATH)/hardware \ -fqbn=$(FQBN) \ $@ endif @@ -61,33 +61,33 @@ ifneq ("$(NO_UPLOAD)","1") -cp $(UPLOAD_PORT) \ -cb $(UPLOAD_BAUD) \ -cd $(UPLOAD_BOARD) \ - -cf "$(LOCAL_BUILD_DIR)/$(notdir $@).bin" + -cf $(LOCAL_BUILD_DIR)/$(notdir $@).bin endif ifneq ("$(NO_RUN)","1") @echo Running tests $(SILENT)$(ESPTOOL) $(UPLOAD_VERBOSE_FLAG) -cp $(UPLOAD_PORT) -cd $(UPLOAD_BOARD) -cr - @source "$(BS_DIR)/virtualenv/bin/activate" && \ - python "$(BS_DIR)/runner.py" \ + @source $(BS_DIR)/virtualenv/bin/activate && \ + python $(BS_DIR)/runner.py \ $(RUNNER_DEBUG_FLAG) \ -p $(UPLOAD_PORT) \ - -n "$(basename $(notdir $@))" \ - -o "$(LOCAL_BUILD_DIR)/test_result.xml" \ + -n $(basename $(notdir $@)) \ + -o $(LOCAL_BUILD_DIR)/test_result.xml \ `test -f $(addsuffix .py, $(basename $@)) && echo "-m $(addsuffix .py, $(basename $@))" || echo ""` endif $(BUILD_DIR): - mkdir -p "$(BUILD_DIR)" + mkdir -p $(BUILD_DIR) $(HARDWARE_DIR): - mkdir -p "$(HARDWARE_DIR)/esp8266com" - cd "$(HARDWARE_DIR)/esp8266com" && ln -s "$(realpath $(ESP8266_CORE_PATH))" esp8266 + mkdir -p $(HARDWARE_DIR)/esp8266com + cd $(HARDWARE_DIR)/esp8266com && ln -s $(realpath $(ESP8266_CORE_PATH)) esp8266 virtualenv: - make -C "$(BS_DIR)" virtualenv + make -C $(BS_DIR) virtualenv clean: - rm -rf "$(BUILD_DIR)" - rm -rf "$(HARDWARE_DIR)" + rm -rf $(BUILD_DIR) + rm -rf $(HARDWARE_DIR) $(TEST_CONFIG): @echo "****** " @@ -96,4 +96,4 @@ $(TEST_CONFIG): @echo "****** " false -.PHONY: tests all count venv "$(BUILD_DIR)" $(TEST_LIST) +.PHONY: tests all count venv $(BUILD_DIR) $(TEST_LIST) From 3893e192d9fad5cea00d1b48700befba1b17a30d Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 4 Jul 2016 22:29:23 +0300 Subject: [PATCH 12/12] add poster as requirement to virtualenv --- tests/device/libraries/BSTest/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/device/libraries/BSTest/requirements.txt b/tests/device/libraries/BSTest/requirements.txt index bc7339b49f..7fce0ce8ee 100644 --- a/tests/device/libraries/BSTest/requirements.txt +++ b/tests/device/libraries/BSTest/requirements.txt @@ -10,3 +10,4 @@ PyYAML==3.11 six==1.10.0 Werkzeug==0.11.9 wheel==0.24.0 +poster==0.8.1