summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml90
-rwxr-xr-xother/travis/toxcore-after_script9
-rwxr-xr-xother/travis/toxcore-install57
-rwxr-xr-xother/travis/toxcore-script25
4 files changed, 107 insertions, 74 deletions
diff --git a/.travis.yml b/.travis.yml
index a62e8c66..527b1b79 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,12 @@
1language: c 1language: c
2compiler: 2compiler:
3 - gcc
4 - clang 3 - clang
4 - gcc
5
6env:
7 matrix:
8# - BUILD=hstox
9 - BUILD=toxcore
5 10
6addons: 11addons:
7 apt: 12 apt:
@@ -10,90 +15,27 @@ addons:
10 packages: 15 packages:
11 - check 16 - check
12 - libvpx-dev 17 - libvpx-dev
13 - opam 18 - opam # For apidsl and Frama-C.
19 - texinfo # For libconfig.
14 20
15cache: 21cache:
16 directories: 22 directories:
17 - $HOME/cache 23 - $HOME/cache
18 24
19before_script: 25install:
20 - pushd .. 26 # Globally used environment variables.
21 - CACHE_DIR=$HOME/cache 27 - export CACHE_DIR=$HOME/cache
22 - export OPAMROOT=$CACHE_DIR/.opam 28 - export OPAMROOT=$CACHE_DIR/.opam
23 - export PKG_CONFIG_PATH=$CACHE_DIR/lib/pkgconfig 29 - export PKG_CONFIG_PATH=$CACHE_DIR/lib/pkgconfig
24 # Set up opam. 30 - export ASTYLE=$CACHE_DIR/astyle/build/gcc/bin/astyle
25 - opam init -y 31 # Install required packages.
26 - eval `opam config env` 32 - other/travis/${BUILD}-install
27 # Install required opam packages.
28 - opam install -y ocamlfind ppx_deriving menhir
29 # Build apidsl.
30 - git clone --depth=1 https://github.com/iphydf/apidsl
31 - make -C apidsl
32 # Install cpp-coveralls to upload test coverage results.
33 - pip install --user cpp-coveralls
34 # Install astyle (version in ubuntu-precise too old).
35 - ASTYLE=$CACHE_DIR/astyle/build/gcc/bin/astyle
36 - >
37 [ -f $ASTYLE ] || {
38 wget -O astyle.tar.gz http://sourceforge.net/projects/astyle/files/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz/download
39 tar -xf astyle.tar.gz -C $CACHE_DIR
40 make -C $CACHE_DIR/astyle/build/gcc
41 }
42 # Install libsodium (not in ubuntu-precise).
43 - >
44 [ -f $CACHE_DIR/lib/libsodium.a ] || {
45 git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium
46 cd libsodium
47 ./autogen.sh
48 ./configure --prefix=$CACHE_DIR
49 make install -j3
50 cd ..
51 }
52 # Install libconfig (version in ubuntu-precise too old).
53 - >
54 [ -f $CACHE_DIR/lib/libconfig.a ] || {
55 git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig
56 cd libconfig
57 autoreconf -fi
58 ./configure --prefix=$CACHE_DIR
59 touch lib/scanner.l
60 make install -j3
61 cd ..
62 }
63 # Install libopus (not in ubuntu-precise).
64 - >
65 [ -f $CACHE_DIR/lib/libopus.a ] || {
66 git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus
67 cd opus
68 ./autogen.sh
69 ./configure --prefix=$CACHE_DIR
70 make install -j3
71 cd ..
72 }
73 - popd
74 33
75script: 34script:
76 # Check if toxcore.h and toxav.h match apidsl tox.in.h and toxav.in.h. 35 - other/travis/${BUILD}-script
77 - ../apidsl/_build/apigen.native ./other/apidsl/tox.in.h | $ASTYLE --options=./other/astyle/astylerc > toxcore/tox.h
78 - ../apidsl/_build/apigen.native ./other/apidsl/toxav.in.h | $ASTYLE --options=./other/astyle/astylerc > toxav/toxav.h
79 - git diff --exit-code
80 # Build toxcore and run tests.
81 - ./autogen.sh
82 - >
83 ./configure \
84 --with-libsodium-libs=$CACHE_DIR/lib \
85 --with-libsodium-headers=$CACHE_DIR/include \
86 --enable-daemon \
87 --enable-logging \
88 --enable-ntox \
89 CFLAGS="-O0 -Wall -Wextra -fprofile-arcs -ftest-coverage -DTRAVIS_ENV"
90 - make
91 - make check
92 - if [ -f build/test-suite.log ]; then cat build/test-suite.log; fi
93 - make dist
94 36
95after_script: 37after_script:
96 - coveralls --exclude auto_tests --exclude other --exclude testing --gcov-options '\-lp' 38 - other/travis/${BUILD}-after_script
97 39
98notifications: 40notifications:
99 irc: "chat.freenode.net#toktok-status" 41 irc: "chat.freenode.net#toktok-status"
diff --git a/other/travis/toxcore-after_script b/other/travis/toxcore-after_script
new file mode 100755
index 00000000..06dec607
--- /dev/null
+++ b/other/travis/toxcore-after_script
@@ -0,0 +1,9 @@
1#!/bin/sh
2
3set -e -x
4
5coveralls \
6 --exclude auto_tests \
7 --exclude other \
8 --exclude testing \
9 --gcov-options '\-lp'
diff --git a/other/travis/toxcore-install b/other/travis/toxcore-install
new file mode 100755
index 00000000..0cd43bc5
--- /dev/null
+++ b/other/travis/toxcore-install
@@ -0,0 +1,57 @@
1#!/bin/sh
2
3set -e -x
4
5cd ..
6
7# Set up opam.
8opam init -y
9eval `opam config env`
10
11# Install required opam packages.
12opam install -y ocamlfind ppx_deriving menhir
13
14# Build apidsl.
15git clone --depth=1 https://github.com/iphydf/apidsl
16make -C apidsl
17
18# Install cpp-coveralls to upload test coverage results.
19pip install --user cpp-coveralls
20
21# Install astyle (version in ubuntu-precise too old).
22[ -f $ASTYLE ] || {
23 wget -O astyle.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/astyle_2.05.1.orig.tar.gz
24 tar -xf astyle.tar.gz -C $CACHE_DIR
25 make -C $CACHE_DIR/astyle/build/gcc
26}
27
28# Install libsodium (not in ubuntu-precise).
29[ -f $CACHE_DIR/lib/libsodium.a ] || {
30 git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium
31 cd libsodium
32 ./autogen.sh
33 ./configure --prefix=$CACHE_DIR
34 make install -j3
35 cd ..
36}
37
38# Install libconfig (version in ubuntu-precise too old).
39[ -f $CACHE_DIR/lib/libconfig.a ] || {
40 git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig
41 cd libconfig
42 autoreconf -fi
43 ./configure --prefix=$CACHE_DIR
44 touch lib/scanner.l
45 make install -j3
46 cd ..
47}
48
49# Install libopus (not in ubuntu-precise).
50[ -f $CACHE_DIR/lib/libopus.a ] || {
51 git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus
52 cd opus
53 ./autogen.sh
54 ./configure --prefix=$CACHE_DIR
55 make install -j3
56 cd ..
57}
diff --git a/other/travis/toxcore-script b/other/travis/toxcore-script
new file mode 100755
index 00000000..b2ee5d02
--- /dev/null
+++ b/other/travis/toxcore-script
@@ -0,0 +1,25 @@
1#!/bin/sh
2
3set -e -x
4
5# Check if toxcore.h and toxav.h match apidsl tox.in.h and toxav.in.h.
6../apidsl/_build/apigen.native ./other/apidsl/tox.in.h | $ASTYLE --options=./other/astyle/astylerc > toxcore/tox.h
7../apidsl/_build/apigen.native ./other/apidsl/toxav.in.h | $ASTYLE --options=./other/astyle/astylerc > toxav/toxav.h
8git diff --exit-code
9
10# Build toxcore and run tests.
11./autogen.sh
12./configure \
13 --with-libsodium-libs=$CACHE_DIR/lib \
14 --with-libsodium-headers=$CACHE_DIR/include \
15 --enable-daemon \
16 --enable-logging \
17 --enable-ntox \
18 CFLAGS="-O0 -Wall -Wextra -fprofile-arcs -ftest-coverage -DTRAVIS_ENV=1"
19
20make
21make check
22if [ -f build/test-suite.log ]; then
23 cat build/test-suite.log
24fi
25make dist