Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 545260d

Browse files
authored
Add tests for the web server (#126)
1 parent f6c8778 commit 545260d

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

travis/build-pio.sh

+25-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
11
#!/bin/bash
22

33
echo -e "travis_fold:start:install_pio"
4-
54
pip install -U platformio
65
if [ $? -ne 0 ]; then exit 1; fi
6+
echo -e "travis_fold:end:install_pio"
77

8-
python -m platformio lib --storage-dir $PWD
8+
echo -e "travis_fold:start:install_lib"
9+
python -m platformio lib --storage-dir $TRAVIS_BUILD_DIR install
910
if [ $? -ne 0 ]; then exit 1; fi
10-
11-
echo -e "travis_fold:end:install_pio"
11+
echo -e "travis_fold:end:install_lib"
1212

1313
echo -e "travis_fold:start:test_pio"
14-
for EXAMPLE in $PWD/examples/*/*.ino; do
14+
for EXAMPLE in $TRAVIS_BUILD_DIR/examples/*/*.ino; do
1515
python -m platformio ci $EXAMPLE -l '.' -b esp12e
1616
if [ $? -ne 0 ]; then exit 1; fi
1717
done
1818
echo -e "travis_fold:end:test_pio"
19+
20+
echo -e "travis_fold:start:install_json"
21+
python -m platformio lib -g install https://github.com/bblanchon/ArduinoJson.git
22+
if [ $? -ne 0 ]; then exit 1; fi
23+
echo -e "travis_fold:end:install_json"
24+
25+
cd $HOME/
26+
echo -e "travis_fold:start:install_web_server"
27+
git clone https://github.com/me-no-dev/ESPAsyncWebServer
28+
if [ $? -ne 0 ]; then exit 1; fi
29+
python -m platformio lib --storage-dir $HOME/ESPAsyncWebServer install
30+
if [ $? -ne 0 ]; then exit 1; fi
31+
echo -e "travis_fold:end:install_web_server"
32+
33+
echo -e "travis_fold:start:test_web_server"
34+
for EXAMPLE in $HOME/ESPAsyncWebServer/examples/*/*.ino; do
35+
python -m platformio ci $EXAMPLE -l $TRAVIS_BUILD_DIR -l $HOME/ESPAsyncWebServer -b esp12e
36+
if [ $? -ne 0 ]; then exit 1; fi
37+
done
38+
echo -e "travis_fold:end:test_web_server"

travis/build.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ cp -rf $TRAVIS_BUILD_DIR ESPAsyncTCP
3131
PLATFORM_EXAMPLES=$TRAVIS_BUILD_DIR/examples
3232

3333
cd $HOME/Arduino/libraries
34-
git clone https://github.com/me-no-dev/ESPAsyncTCP
34+
git clone https://github.com/me-no-dev/ESPAsyncWebServer
35+
git clone https://github.com/bblanchon/ArduinoJson
36+
LIB_EXAMPLES=$HOME/Arduino/libraries/ESPAsyncWebServer/examples
37+
3538
cd $HOME/Arduino/hardware
3639
mkdir esp8266com
3740
cd esp8266com
@@ -99,9 +102,9 @@ function build_sketch()
99102

100103
function count_sketches()
101104
{
102-
local sketches=$(find $PLATFORM_EXAMPLES -name *.ino)
105+
local path=$1
106+
local sketches=$(find $path -name *.ino)
103107
local sketchnum=0
104-
rm -rf sketches.txt
105108
for sketch in $sketches; do
106109
local sketchdir=$(dirname $sketch)
107110
local sketchdirname=$(basename $sketchdir)
@@ -124,8 +127,12 @@ function build_sketches()
124127

125128
local chunk_idex=$1
126129
local chunks_num=$2
127-
count_sketches
130+
rm -rf sketches.txt
131+
count_sketches $PLATFORM_EXAMPLES
128132
local sketchcount=$?
133+
count_sketches $LIB_EXAMPLES
134+
local libsketchcount=$?
135+
sketchcount=$(($sketchcount + $libsketchcount))
129136
local sketches=$(cat sketches.txt)
130137

131138
local chunk_size=$(( $sketchcount / $chunks_num ))

0 commit comments

Comments
 (0)