1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Merge pull request #595 from esp8266/travis-tests

Verify sketches as part of travis build
This commit is contained in:
Ivan Grokhotkov 2015-07-23 16:19:29 +03:00
commit 973ae3986b
10 changed files with 115 additions and 91 deletions

View File

@ -1,35 +1,38 @@
sudo: true
sudo: false
language: java
os:
- linux
- osx
addons:
apt:
packages:
- ant
jdk:
- oraclejdk8
script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install -qq ant; fi
- pushd build
- echo "" | ant dist
- echo "" | ant build
- popd
#- bash -x ./generate-appimage
deploy:
provider: releases
api_key:
secure: eKHcAMuC58JZKRsn1QwbiYE4aL/9dZsybDqqHTo1dUo8x9+3fGed/Dci76ItFFS7SmFfIdl6ej8/Uj0nPK/sIE21blKBe3+L0KAJm0TTq3m0ig1suCmMipCsSW+srWYM0hl58+OKagM4FoHKDjsEnzRDv9Z4xtxyvG+7/XLD1dE=
skip_cleanup: true
file_glob: true
file:
- '$TRAVIS_BUILD_DIR/build/linux/arduino-*.tar.xz'
# - '$TRAVIS_BUILD_DIR/Arduino.AppImage'
on:
tags: true
all_branches: true
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
- sleep 3
- export DISPLAY=:1.0
- export PATH="$PWD/build/linux/work:$PATH"
- which arduino
- source hardware/esp8266com/esp8266/tests/common.sh
- arduino --board esp8266com:esp8266:generic --save-prefs
- build_sketches arduino $PWD/hardware/esp8266com/esp8266
notifications:
email:
on_success: change
on_failure: change
webhooks:
urls:
- secure: "dnSY+KA7NK+KD+Z71copmANDUsyVePrZ0iXvXxmqMEQv+lp3j2Z87G5pHn7j0WNcNZrejJqOdbElJ9Q4QESRaAYxTR7cA6ameJeEKHiFJrQtN/4abvoXb9E1CxpL8aNON/xgnqCk+fycOK3nbWWXlJBodzBm7KN64vrcHO7et+M="
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false

View File

@ -1,5 +1,4 @@
#include <ESP8266WiFi.h>
#include <WiFiUDP.h>
#include <ESP8266WebServer.h>
#include <ESP8266SSDP.h>

View File

@ -38,9 +38,8 @@
const char* ssid = "**********";
const char* password = "**********";
const char* hostname = "esp8266sd";
const char* host = "esp8266sd";
MDNSResponder mdns;
ESP8266WebServer server(80);
static bool hasSD = false;
@ -245,10 +244,11 @@ void setup(void){
DBG_OUTPUT_PORT.print("Connected! IP address: ");
DBG_OUTPUT_PORT.println(WiFi.localIP());
if (mdns.begin(hostname, WiFi.localIP())) {
if (MDNS.begin(host)) {
MDNS.addService("http", "tcp", 80);
DBG_OUTPUT_PORT.println("MDNS responder started");
DBG_OUTPUT_PORT.print("You can now connect to http://");
DBG_OUTPUT_PORT.print(hostname);
DBG_OUTPUT_PORT.print(host);
DBG_OUTPUT_PORT.println(".local");
}

View File

@ -19,12 +19,12 @@ Usage
-----
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).
2. Include the ESP8266mDNS library in the sketch.
3. Create an instance of the MDNSResponder class.
4. Call the begin method in the sketch's setup and provide a domain name (without
the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'), and the
IP address to advertise. Optionally provide a time to live (in seconds)
for the DNS record--the default is 1 hour.
5. Call the update method in each iteration of the sketch's loop function.
3. Call MDNS.begin method in the sketch's setup and provide a domain name (without
the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'). Optionally provide
the IP address to advertise and time to live (in seconds) for the DNS record -- the default is 1 hour.
4. To advertise DNS-SD services, call MDNS.addService(service, proto, port), where service and proto
are strings with service and protocol name (e.g. "http", "tcp"), and port is an integer port number
for this service (e.g. 80).
See the included MDNS + HTTP server sketch for a full example.

View File

@ -1,6 +1,6 @@
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUDP.h>
#include <WiFiUdp.h>
const char* host = "esp8266-ota";
const char* ssid = "**********";

22
tests/common.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
function build_sketches()
{
local arduino=$1
local srcpath=$2
local sketches=$(find $srcpath -name *.ino)
for sketch in $sketches; do
local sketchdir=$(dirname $sketch)
if [[ -f "$sketchdir/.test.skip" ]]; then
echo -e "\n\n ------------ Skipping $sketch ------------ \n\n";
continue
fi
echo -e "\n\n ------------ Building $sketch ------------ \n\n";
$arduino --verify --verbose $sketch;
local result=$?
if [ $result -ne 0 ]; then
echo "Build failed ($1)"
return $result
fi
done
}