]> prime8.dev >> repos - ttyd.git/commitdiff
travis: test both 1.7.x and 2.0.x version of libwebsockets
authorShuanglei Tao <tsl0922@gmail.com>
Tue, 20 Sep 2016 12:38:12 +0000 (20:38 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Tue, 20 Sep 2016 12:54:30 +0000 (20:54 +0800)
.travis.yml
src/server.h

index af258f10833a0e3b5c089d34198329c849a80892..189ef6d251bd405401f69a03374b73858d519cad 100644 (file)
@@ -2,16 +2,27 @@ language: c
 os:
   - linux
   - osx
+env:
+  - LIBWEBSOCKETS_VERSION=v1.7.9
+  - LIBWEBSOCKETS_VERSION=v2.0.3
 sudo: required
 dist: trusty
+branches:
+  only:
+    - master
+addons:
+  apt:
+    packages:
+      - cmake
+      - libjson-c-dev
+      - libssl-dev
 install:
   - echo $TRAVIS_OS_NAME
-  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -q; sudo apt-get install -y cmake libjson-c-dev libssl-dev; fi
-  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then pushd /tmp; curl -sLo- https://github.com/warmcat/libwebsockets/archive/v2.0.2.tar.gz | tar xz; cd libwebsockets-2.0.2; cmake .; make && sudo make install; popd; fi
-  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; brew unlink cmake json-c; brew install cmake openssl json-c libwebsockets; fi
+  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; brew unlink cmake json-c; brew install cmake openssl json-c; fi
+  - echo "Compiling libwebsockets-$LIBWEBSOCKETS_VERSION from source..."
+  - pushd /tmp; curl -sLo- https://github.com/warmcat/libwebsockets/archive/$LIBWEBSOCKETS_VERSION.tar.gz | tar xz; cd libwebsockets-*; cmake .; make && sudo make install; popd
 script:
   - echo $TRAVIS_OS_NAME
   - cmake --version
   - mkdir build && cd build
-  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then cmake .. && make; fi
-  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make; fi
\ No newline at end of file
+  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make; else cmake .. && make; fi
index dd29ed4b48e839d62cd5091ed2cd54bf6926db9e..a71264a2cef14d23da8d2ec4a89dfae2b6c4671a 100644 (file)
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <stdbool.h>
 #include <signal.h>
+#include <errno.h>
 #include <string.h>
 #include <fcntl.h>
 #include <getopt.h>