Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2. Hstox test #30

Merged
merged 1 commit into from
Aug 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,36 @@ compiler:

env:
matrix:
# - BUILD=hstox
- BUILD=hstox
- BUILD=toxcore

addons:
apt:
sources:
- avsm
- hvr-ghc
packages:
- cabal-install-1.22
- check
- ghc-7.10.3
- libvpx-dev
- opam # For apidsl and Frama-C.
- texinfo # For libconfig.

cache:
directories:
- $HOME/.cabal
- $HOME/.ghc
- $HOME/cache

install:
# Set up PATH for the /opt packages.
- export PATH=/opt/cabal/1.22/bin:$PATH
- export PATH=/opt/ghc/7.10.3/bin:$PATH
# Globally used environment variables.
- export CACHE_DIR=$HOME/cache
- export OPAMROOT=$CACHE_DIR/.opam
- export LD_LIBRARY_PATH=$CACHE_DIR/lib
- export PKG_CONFIG_PATH=$CACHE_DIR/lib/pkgconfig
- export ASTYLE=$CACHE_DIR/astyle/build/gcc/bin/astyle
# Install required packages.
Expand Down
3 changes: 3 additions & 0 deletions other/travis/hstox-after_script
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

set -e -x
23 changes: 23 additions & 0 deletions other/travis/hstox-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -e -x

cabal update

# We need to install happy explicitly, otherwise setup-Simple-Cabal will fail to
# install.
cabal install happy

# Fetch hstox.
git clone --recursive --depth=1 https://github.com/TokTok/hstox ../hstox

# Delete all files in the cloned toxcore.
rm -rf ../hstox/test/toxcore/toxcore/toxcore
# Move the toxcore source files to the hstox test directory.
# The reason we move source files instead of the whole git root directory is
# that the travis scripts (like this one) need to remain in place.
mv toxcore ../hstox/test/toxcore/toxcore

# In the "install" step, we only run configure, which downloads the required
# packages. In the "script" step we then build the actual code.
make -C ../hstox configure
5 changes: 5 additions & 0 deletions other/travis/hstox-script
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e -x

make -C ../hstox check-toxcore
28 changes: 13 additions & 15 deletions other/travis/toxcore-install
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

set -e -x

cd ..

# Set up opam.
opam init -y
eval `opam config env`
Expand All @@ -12,46 +10,46 @@ eval `opam config env`
opam install -y ocamlfind ppx_deriving menhir

# Build apidsl.
git clone --depth=1 https://github.com/iphydf/apidsl
make -C apidsl
git clone --depth=1 https://github.com/iphydf/apidsl ../apidsl
make -C ../apidsl

# Install cpp-coveralls to upload test coverage results.
pip install --user cpp-coveralls

# Install astyle (version in ubuntu-precise too old).
[ -f $ASTYLE ] || {
wget -O astyle.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/astyle_2.05.1.orig.tar.gz
tar -xf astyle.tar.gz -C $CACHE_DIR
wget -O ../astyle.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/astyle_2.05.1.orig.tar.gz
tar -xf ../astyle.tar.gz -C $CACHE_DIR
make -C $CACHE_DIR/astyle/build/gcc
}

# Install libsodium (not in ubuntu-precise).
[ -f $CACHE_DIR/lib/libsodium.a ] || {
git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium
cd libsodium
git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium ../libsodium
cd ../libsodium # pushd
./autogen.sh
./configure --prefix=$CACHE_DIR
make install -j3
cd ..
cd - # popd
}

# Install libconfig (version in ubuntu-precise too old).
[ -f $CACHE_DIR/lib/libconfig.a ] || {
git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig
cd libconfig
git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig ../libconfig
cd ../libconfig # pushd
autoreconf -fi
./configure --prefix=$CACHE_DIR
touch lib/scanner.l
make install -j3
cd ..
cd - # popd
}

# Install libopus (not in ubuntu-precise).
[ -f $CACHE_DIR/lib/libopus.a ] || {
git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus
cd opus
git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus ../opus
cd ../opus # pushd
./autogen.sh
./configure --prefix=$CACHE_DIR
make install -j3
cd ..
cd - # popd
}