Skip to content

Commit 973ae39

Browse files
committed
Merge pull request #595 from esp8266/travis-tests
Verify sketches as part of travis build
2 parents d35b72d + 496da02 commit 973ae39

File tree

10 files changed

+115
-91
lines changed

10 files changed

+115
-91
lines changed

.travis.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
1-
sudo: true
1+
sudo: false
2+
23
language: java
34

45
os:
56
- linux
6-
- osx
7+
8+
addons:
9+
apt:
10+
packages:
11+
- ant
712

813
jdk:
914
- oraclejdk8
1015

1116
script:
12-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; fi
13-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install -qq ant; fi
1417
- pushd build
15-
- echo "" | ant dist
18+
- echo "" | ant build
1619
- popd
17-
#- bash -x ./generate-appimage
18-
19-
deploy:
20-
provider: releases
21-
api_key:
22-
secure: eKHcAMuC58JZKRsn1QwbiYE4aL/9dZsybDqqHTo1dUo8x9+3fGed/Dci76ItFFS7SmFfIdl6ej8/Uj0nPK/sIE21blKBe3+L0KAJm0TTq3m0ig1suCmMipCsSW+srWYM0hl58+OKagM4FoHKDjsEnzRDv9Z4xtxyvG+7/XLD1dE=
23-
skip_cleanup: true
24-
file_glob: true
25-
file:
26-
- '$TRAVIS_BUILD_DIR/build/linux/arduino-*.tar.xz'
27-
# - '$TRAVIS_BUILD_DIR/Arduino.AppImage'
28-
on:
29-
tags: true
30-
all_branches: true
20+
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
21+
- sleep 3
22+
- export DISPLAY=:1.0
23+
- export PATH="$PWD/build/linux/work:$PATH"
24+
- which arduino
25+
- source hardware/esp8266com/esp8266/tests/common.sh
26+
- arduino --board esp8266com:esp8266:generic --save-prefs
27+
- build_sketches arduino $PWD/hardware/esp8266com/esp8266
3128

3229
notifications:
3330
email:
3431
on_success: change
3532
on_failure: change
33+
webhooks:
34+
urls:
35+
- secure: "dnSY+KA7NK+KD+Z71copmANDUsyVePrZ0iXvXxmqMEQv+lp3j2Z87G5pHn7j0WNcNZrejJqOdbElJ9Q4QESRaAYxTR7cA6ameJeEKHiFJrQtN/4abvoXb9E1CxpL8aNON/xgnqCk+fycOK3nbWWXlJBodzBm7KN64vrcHO7et+M="
36+
on_success: change # options: [always|never|change] default: always
37+
on_failure: always # options: [always|never|change] default: always
38+
on_start: false # default: false

libraries/ESP8266SSDP/examples/SSDP/SSDP.ino

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include <ESP8266WiFi.h>
2-
#include <WiFiUDP.h>
32
#include <ESP8266WebServer.h>
43
#include <ESP8266SSDP.h>
54

@@ -12,11 +11,11 @@ void setup() {
1211
Serial.begin(115200);
1312
Serial.println();
1413
Serial.println("Starting WiFi...");
15-
14+
1615
WiFi.mode(WIFI_STA);
1716
WiFi.begin(ssid, password);
1817
if(WiFi.waitForConnectResult() == WL_CONNECTED){
19-
18+
2019
Serial.printf("Starting HTTP...\n");
2120
HTTP.on("/index.html", HTTP_GET, [](){
2221
HTTP.send(200, "text/plain", "Hello World!");
@@ -25,7 +24,7 @@ void setup() {
2524
SSDP.schema(HTTP.client());
2625
});
2726
HTTP.begin();
28-
27+
2928
Serial.printf("Starting SSDP...\n");
3029
SSDP.setSchemaURL("description.xml");
3130
SSDP.setHTTPPort(80);
@@ -38,7 +37,7 @@ void setup() {
3837
SSDP.setManufacturer("Royal Philips Electronics");
3938
SSDP.setManufacturerURL("http://www.philips.com");
4039
SSDP.begin();
41-
40+
4241
Serial.printf("Ready!\n");
4342
} else {
4443
Serial.printf("WiFi Failed\n");

libraries/ESP8266WebServer/examples/SDWebServer/SDWebServer.ino

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/*
1+
/*
22
SDWebServer - Example WebServer with SD Card backend for esp8266
33
44
Copyright (c) 2015 Hristo Gochkov. All rights reserved.
55
This file is part of the ESP8266WebServer library for Arduino environment.
6-
6+
77
This library is free software; you can redistribute it and/or
88
modify it under the terms of the GNU Lesser General Public
99
License as published by the Free Software Foundation; either
@@ -23,7 +23,7 @@
2323
File extensions with more than 3 charecters are not supported by the SD Library
2424
File Names longer than 8 charecters will be truncated by the SD library, so keep filenames shorter
2525
index.htm is the default index (works on subfolders as well)
26-
26+
2727
upload the contents of SdRoot to the root of the SDcard and access the editor by going to http://esp8266sd.local/edit
2828
2929
*/
@@ -38,9 +38,8 @@
3838

3939
const char* ssid = "**********";
4040
const char* password = "**********";
41-
const char* hostname = "esp8266sd";
41+
const char* host = "esp8266sd";
4242

43-
MDNSResponder mdns;
4443
ESP8266WebServer server(80);
4544

4645
static bool hasSD = false;
@@ -62,7 +61,7 @@ void returnFail(String msg) {
6261
bool loadFromSdCard(String path){
6362
String dataType = "text/plain";
6463
if(path.endsWith("/")) path += "index.htm";
65-
64+
6665
if(path.endsWith(".src")) path = path.substring(0, path.lastIndexOf("."));
6766
else if(path.endsWith(".htm")) dataType = "text/html";
6867
else if(path.endsWith(".css")) dataType = "text/css";
@@ -74,7 +73,7 @@ bool loadFromSdCard(String path){
7473
else if(path.endsWith(".xml")) dataType = "text/xml";
7574
else if(path.endsWith(".pdf")) dataType = "application/pdf";
7675
else if(path.endsWith(".zip")) dataType = "application/zip";
77-
76+
7877
File dataFile = SD.open(path.c_str());
7978
if(dataFile.isDirectory()){
8079
path += "/index.htm";
@@ -84,9 +83,9 @@ bool loadFromSdCard(String path){
8483

8584
if (!dataFile)
8685
return false;
87-
86+
8887
if (server.hasArg("download")) dataType = "application/octet-stream";
89-
88+
9089
if (server.streamFile(dataFile, dataType) != dataFile.size()) {
9190
DBG_OUTPUT_PORT.println("Sent less data than expected!");
9291
}
@@ -152,7 +151,7 @@ void handleDelete(){
152151
void handleCreate(){
153152
if(server.args() == 0) return returnFail("BAD ARGS");
154153
String path = server.arg(0);
155-
if(path == "/" || SD.exists((char *)path.c_str())) {
154+
if(path == "/" || SD.exists((char *)path.c_str())) {
156155
returnFail("BAD PATH");
157156
return;
158157
}
@@ -183,7 +182,7 @@ void printDirectory() {
183182
server.setContentLength(CONTENT_LENGTH_UNKNOWN);
184183
server.send(200, "text/json", "");
185184
WiFiClient client = server.client();
186-
185+
187186
server.sendContent("[");
188187
for (int cnt = 0; true; ++cnt) {
189188
File entry = dir.openNextFile();
@@ -244,25 +243,26 @@ void setup(void){
244243
}
245244
DBG_OUTPUT_PORT.print("Connected! IP address: ");
246245
DBG_OUTPUT_PORT.println(WiFi.localIP());
247-
248-
if (mdns.begin(hostname, WiFi.localIP())) {
246+
247+
if (MDNS.begin(host)) {
248+
MDNS.addService("http", "tcp", 80);
249249
DBG_OUTPUT_PORT.println("MDNS responder started");
250250
DBG_OUTPUT_PORT.print("You can now connect to http://");
251-
DBG_OUTPUT_PORT.print(hostname);
251+
DBG_OUTPUT_PORT.print(host);
252252
DBG_OUTPUT_PORT.println(".local");
253253
}
254-
255-
254+
255+
256256
server.on("/list", HTTP_GET, printDirectory);
257257
server.on("/edit", HTTP_DELETE, handleDelete);
258258
server.on("/edit", HTTP_PUT, handleCreate);
259259
server.on("/edit", HTTP_POST, [](){ returnOK(); });
260260
server.onNotFound(handleNotFound);
261261
server.onFileUpload(handleFileUpload);
262-
262+
263263
server.begin();
264264
DBG_OUTPUT_PORT.println("HTTP server started");
265-
265+
266266
if (SD.begin(SS)){
267267
DBG_OUTPUT_PORT.println("SD Card initialized.");
268268
hasSD = true;

libraries/ESP8266mDNS/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ Usage
1919
-----
2020
1. Download this repository as a zip (button on the right) and follow [these instructions to install into Arduino](http://arduino.cc/en/Guide/Libraries).
2121
2. Include the ESP8266mDNS library in the sketch.
22-
3. Create an instance of the MDNSResponder class.
23-
4. Call the begin method in the sketch's setup and provide a domain name (without
24-
the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'), and the
25-
IP address to advertise. Optionally provide a time to live (in seconds)
26-
for the DNS record--the default is 1 hour.
27-
5. Call the update method in each iteration of the sketch's loop function.
22+
3. Call MDNS.begin method in the sketch's setup and provide a domain name (without
23+
the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'). Optionally provide
24+
the IP address to advertise and time to live (in seconds) for the DNS record -- the default is 1 hour.
25+
4. To advertise DNS-SD services, call MDNS.addService(service, proto, port), where service and proto
26+
are strings with service and protocol name (e.g. "http", "tcp"), and port is an integer port number
27+
for this service (e.g. 80).
2828

2929
See the included MDNS + HTTP server sketch for a full example.
3030

@@ -49,4 +49,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
4949
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5050
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5151
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
52-
THE SOFTWARE.
52+
THE SOFTWARE.

libraries/ESP8266mDNS/examples/DNS_SD_Arduino_OTA/DNS_SD_Arduino_OTA.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#include <ESP8266WiFi.h>
22
#include <ESP8266mDNS.h>
3-
#include <WiFiUDP.h>
4-
3+
#include <WiFiUdp.h>
4+
55
const char* host = "esp8266-ota";
66
const char* ssid = "**********";
77
const char* pass = "**********";
88
const uint16_t aport = 8266;
9-
9+
1010
WiFiServer TelnetServer(aport);
1111
WiFiClient Telnet;
1212
WiFiUDP OTA;
@@ -15,10 +15,10 @@ void setup() {
1515
Serial.begin(115200);
1616
Serial.println("");
1717
Serial.println("Arduino OTA Test");
18-
18+
1919
Serial.printf("Sketch size: %u\n", ESP.getSketchSize());
2020
Serial.printf("Free size: %u\n", ESP.getFreeSketchSpace());
21-
21+
2222
WiFi.begin(ssid, pass);
2323
if(WiFi.waitForConnectResult() == WL_CONNECTED){
2424
MDNS.begin(host);
@@ -43,24 +43,24 @@ void loop() {
4343
Serial.print(remote);
4444
Serial.printf(", port:%d, size:%d\n", port, size);
4545
uint32_t startTime = millis();
46-
46+
4747
WiFiUDP::stopAll();
48-
48+
4949
if(!Update.begin(size)){
5050
Serial.println("Update Begin Error");
5151
return;
5252
}
53-
53+
5454
WiFiClient client;
5555
if (client.connect(remote, port)) {
56-
56+
5757
uint32_t written;
5858
while(!Update.isFinished()){
5959
written = Update.write(client);
6060
if(written > 0) client.print(written, DEC);
6161
}
6262
Serial.setDebugOutput(false);
63-
63+
6464
if(Update.end()){
6565
client.println("OK");
6666
Serial.printf("Update Success: %u\nRebooting...\n", millis() - startTime);
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
/**
2-
* simple demo to show sha1 calculation
3-
*/
4-
#include <Arduino.h>
5-
#include <Hash.h>
6-
7-
void setup() {
8-
Serial.begin(921600);
9-
}
10-
11-
void loop() {
12-
13-
// usage as String
14-
// SHA1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
15-
16-
Serial.print("SHA1:");
17-
Serial.println(sha1("abc"));
18-
19-
// usage as ptr
20-
// SHA1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
21-
uint8_t hash[20];
22-
sha1("abc", &hash[0]);
23-
24-
Serial.print("SHA1:");
25-
for(uint16_t i = 0; i < 20; i++) {
26-
Serial.printf("%02x", hash[i]);
27-
}
28-
Serial.println();
29-
30-
delay(1000);
31-
}
32-
1+
/**
2+
* simple demo to show sha1 calculation
3+
*/
4+
#include <Arduino.h>
5+
#include <Hash.h>
6+
7+
void setup() {
8+
Serial.begin(921600);
9+
}
10+
11+
void loop() {
12+
13+
// usage as String
14+
// SHA1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
15+
16+
Serial.print("SHA1:");
17+
Serial.println(sha1("abc"));
18+
19+
// usage as ptr
20+
// SHA1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
21+
uint8_t hash[20];
22+
sha1("abc", &hash[0]);
23+
24+
Serial.print("SHA1:");
25+
for(uint16_t i = 0; i < 20; i++) {
26+
Serial.printf("%02x", hash[i]);
27+
}
28+
Serial.println();
29+
30+
delay(1000);
31+
}
32+

libraries/TFT_Touch_Shield_V2/examples/paint/.test.skip

Whitespace-only changes.

libraries/TFT_Touch_Shield_V2/examples/tftbmp/.test.skip

Whitespace-only changes.

libraries/TFT_Touch_Shield_V2/examples/tftbmp2/.test.skip

Whitespace-only changes.

tests/common.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
function build_sketches()
4+
{
5+
local arduino=$1
6+
local srcpath=$2
7+
local sketches=$(find $srcpath -name *.ino)
8+
for sketch in $sketches; do
9+
local sketchdir=$(dirname $sketch)
10+
if [[ -f "$sketchdir/.test.skip" ]]; then
11+
echo -e "\n\n ------------ Skipping $sketch ------------ \n\n";
12+
continue
13+
fi
14+
echo -e "\n\n ------------ Building $sketch ------------ \n\n";
15+
$arduino --verify --verbose $sketch;
16+
local result=$?
17+
if [ $result -ne 0 ]; then
18+
echo "Build failed ($1)"
19+
return $result
20+
fi
21+
done
22+
}

0 commit comments

Comments
 (0)