diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-07-13 15:18:03 +0200 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-08-12 00:22:09 +0100 |
commit | 8339e3449f41f5d6edd16a8657f7faa84040fdc3 (patch) | |
tree | 1d6818211d7717f0817c4e8b82fbcceb736f2f99 | |
parent | 50921070ce5afa907a61ac8c041e1c5ef2092c33 (diff) |
Run hstox test suite against toxcore on Travis.
-rw-r--r-- | .travis.yml | 11 | ||||
-rwxr-xr-x | other/travis/hstox-after_script | 3 | ||||
-rwxr-xr-x | other/travis/hstox-install | 23 | ||||
-rwxr-xr-x | other/travis/hstox-script | 5 | ||||
-rwxr-xr-x | other/travis/toxcore-install | 28 |
5 files changed, 54 insertions, 16 deletions
diff --git a/.travis.yml b/.travis.yml index 527b1b79..2ced7f3c 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -5,27 +5,36 @@ compiler: | |||
5 | 5 | ||
6 | env: | 6 | env: |
7 | matrix: | 7 | matrix: |
8 | # - BUILD=hstox | 8 | - BUILD=hstox |
9 | - BUILD=toxcore | 9 | - BUILD=toxcore |
10 | 10 | ||
11 | addons: | 11 | addons: |
12 | apt: | 12 | apt: |
13 | sources: | 13 | sources: |
14 | - avsm | 14 | - avsm |
15 | - hvr-ghc | ||
15 | packages: | 16 | packages: |
17 | - cabal-install-1.22 | ||
16 | - check | 18 | - check |
19 | - ghc-7.10.3 | ||
17 | - libvpx-dev | 20 | - libvpx-dev |
18 | - opam # For apidsl and Frama-C. | 21 | - opam # For apidsl and Frama-C. |
19 | - texinfo # For libconfig. | 22 | - texinfo # For libconfig. |
20 | 23 | ||
21 | cache: | 24 | cache: |
22 | directories: | 25 | directories: |
26 | - $HOME/.cabal | ||
27 | - $HOME/.ghc | ||
23 | - $HOME/cache | 28 | - $HOME/cache |
24 | 29 | ||
25 | install: | 30 | install: |
31 | # Set up PATH for the /opt packages. | ||
32 | - export PATH=/opt/cabal/1.22/bin:$PATH | ||
33 | - export PATH=/opt/ghc/7.10.3/bin:$PATH | ||
26 | # Globally used environment variables. | 34 | # Globally used environment variables. |
27 | - export CACHE_DIR=$HOME/cache | 35 | - export CACHE_DIR=$HOME/cache |
28 | - export OPAMROOT=$CACHE_DIR/.opam | 36 | - export OPAMROOT=$CACHE_DIR/.opam |
37 | - export LD_LIBRARY_PATH=$CACHE_DIR/lib | ||
29 | - export PKG_CONFIG_PATH=$CACHE_DIR/lib/pkgconfig | 38 | - export PKG_CONFIG_PATH=$CACHE_DIR/lib/pkgconfig |
30 | - export ASTYLE=$CACHE_DIR/astyle/build/gcc/bin/astyle | 39 | - export ASTYLE=$CACHE_DIR/astyle/build/gcc/bin/astyle |
31 | # Install required packages. | 40 | # Install required packages. |
diff --git a/other/travis/hstox-after_script b/other/travis/hstox-after_script new file mode 100755 index 00000000..0f4ddcd5 --- /dev/null +++ b/other/travis/hstox-after_script | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e -x | ||
diff --git a/other/travis/hstox-install b/other/travis/hstox-install new file mode 100755 index 00000000..839dfd04 --- /dev/null +++ b/other/travis/hstox-install | |||
@@ -0,0 +1,23 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e -x | ||
4 | |||
5 | cabal update | ||
6 | |||
7 | # We need to install happy explicitly, otherwise setup-Simple-Cabal will fail to | ||
8 | # install. | ||
9 | cabal install happy | ||
10 | |||
11 | # Fetch hstox. | ||
12 | git clone --recursive --depth=1 https://github.com/TokTok/hstox ../hstox | ||
13 | |||
14 | # Delete all files in the cloned toxcore. | ||
15 | rm -rf ../hstox/test/toxcore/toxcore/toxcore | ||
16 | # Move the toxcore source files to the hstox test directory. | ||
17 | # The reason we move source files instead of the whole git root directory is | ||
18 | # that the travis scripts (like this one) need to remain in place. | ||
19 | mv toxcore ../hstox/test/toxcore/toxcore | ||
20 | |||
21 | # In the "install" step, we only run configure, which downloads the required | ||
22 | # packages. In the "script" step we then build the actual code. | ||
23 | make -C ../hstox configure | ||
diff --git a/other/travis/hstox-script b/other/travis/hstox-script new file mode 100755 index 00000000..6e19ee11 --- /dev/null +++ b/other/travis/hstox-script | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e -x | ||
4 | |||
5 | make -C ../hstox check-toxcore | ||
diff --git a/other/travis/toxcore-install b/other/travis/toxcore-install index 0cd43bc5..f3b213ac 100755 --- a/other/travis/toxcore-install +++ b/other/travis/toxcore-install | |||
@@ -2,8 +2,6 @@ | |||
2 | 2 | ||
3 | set -e -x | 3 | set -e -x |
4 | 4 | ||
5 | cd .. | ||
6 | |||
7 | # Set up opam. | 5 | # Set up opam. |
8 | opam init -y | 6 | opam init -y |
9 | eval `opam config env` | 7 | eval `opam config env` |
@@ -12,46 +10,46 @@ eval `opam config env` | |||
12 | opam install -y ocamlfind ppx_deriving menhir | 10 | opam install -y ocamlfind ppx_deriving menhir |
13 | 11 | ||
14 | # Build apidsl. | 12 | # Build apidsl. |
15 | git clone --depth=1 https://github.com/iphydf/apidsl | 13 | git clone --depth=1 https://github.com/iphydf/apidsl ../apidsl |
16 | make -C apidsl | 14 | make -C ../apidsl |
17 | 15 | ||
18 | # Install cpp-coveralls to upload test coverage results. | 16 | # Install cpp-coveralls to upload test coverage results. |
19 | pip install --user cpp-coveralls | 17 | pip install --user cpp-coveralls |
20 | 18 | ||
21 | # Install astyle (version in ubuntu-precise too old). | 19 | # Install astyle (version in ubuntu-precise too old). |
22 | [ -f $ASTYLE ] || { | 20 | [ -f $ASTYLE ] || { |
23 | wget -O astyle.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/astyle_2.05.1.orig.tar.gz | 21 | 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 | 22 | tar -xf ../astyle.tar.gz -C $CACHE_DIR |
25 | make -C $CACHE_DIR/astyle/build/gcc | 23 | make -C $CACHE_DIR/astyle/build/gcc |
26 | } | 24 | } |
27 | 25 | ||
28 | # Install libsodium (not in ubuntu-precise). | 26 | # Install libsodium (not in ubuntu-precise). |
29 | [ -f $CACHE_DIR/lib/libsodium.a ] || { | 27 | [ -f $CACHE_DIR/lib/libsodium.a ] || { |
30 | git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium | 28 | git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium ../libsodium |
31 | cd libsodium | 29 | cd ../libsodium # pushd |
32 | ./autogen.sh | 30 | ./autogen.sh |
33 | ./configure --prefix=$CACHE_DIR | 31 | ./configure --prefix=$CACHE_DIR |
34 | make install -j3 | 32 | make install -j3 |
35 | cd .. | 33 | cd - # popd |
36 | } | 34 | } |
37 | 35 | ||
38 | # Install libconfig (version in ubuntu-precise too old). | 36 | # Install libconfig (version in ubuntu-precise too old). |
39 | [ -f $CACHE_DIR/lib/libconfig.a ] || { | 37 | [ -f $CACHE_DIR/lib/libconfig.a ] || { |
40 | git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig | 38 | git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig ../libconfig |
41 | cd libconfig | 39 | cd ../libconfig # pushd |
42 | autoreconf -fi | 40 | autoreconf -fi |
43 | ./configure --prefix=$CACHE_DIR | 41 | ./configure --prefix=$CACHE_DIR |
44 | touch lib/scanner.l | 42 | touch lib/scanner.l |
45 | make install -j3 | 43 | make install -j3 |
46 | cd .. | 44 | cd - # popd |
47 | } | 45 | } |
48 | 46 | ||
49 | # Install libopus (not in ubuntu-precise). | 47 | # Install libopus (not in ubuntu-precise). |
50 | [ -f $CACHE_DIR/lib/libopus.a ] || { | 48 | [ -f $CACHE_DIR/lib/libopus.a ] || { |
51 | git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus | 49 | git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus ../opus |
52 | cd opus | 50 | cd ../opus # pushd |
53 | ./autogen.sh | 51 | ./autogen.sh |
54 | ./configure --prefix=$CACHE_DIR | 52 | ./configure --prefix=$CACHE_DIR |
55 | make install -j3 | 53 | make install -j3 |
56 | cd .. | 54 | cd - # popd |
57 | } | 55 | } |