Skip to content

Commit

Permalink
Create a seperate build for to run the format tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory Mullen (grayhatter) committed Jan 1, 2017
1 parent 4dc38c0 commit d65fc28
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Thumbs.db
*.tmp

# Make
/_build
/_build*
/_install
/tox-0.0.0*
CMakeCache.txt
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ matrix:
ghc: 7.8
- env: JOB=autotools ENV=linux
compiler: gcc
- env: JOB=formatting ENV=linux
compiler: gcc
- env: JOB=toxcore ENV=linux
compiler: clang
- env: JOB=toxcore ENV=osx
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the numb

option(FORMAT_TEST "Require the format_test to be executed; fail cmake if it can't" OFF)

if(APIDSL AND ASTYLE)
if(APIDSL AND ASTYLE AND FORMAT_TEST)
add_test(
NAME format_test
COMMAND ${toxcore_SOURCE_DIR}/other/astyle/format-source
Expand Down
2 changes: 1 addition & 1 deletion other/travis/env-linux.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

CMAKE=cmake
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DFORMAT_TEST=ON"
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS"
NPROC=`nproc`
CURDIR=$PWD

Expand Down
31 changes: 31 additions & 0 deletions other/travis/formatting-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

# Set up opam.
opam init -y
eval `opam config env`

# Install required opam packages.
opam install -y ocamlfind ppx_deriving menhir

# Build apidsl.
git clone --depth=1 https://github.com/TokTok/apidsl ../apidsl
make -C ../apidsl -j$NPROC


# 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
make -C $CACHE_DIR/astyle/build/gcc -j$NPROC
}

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

11 changes: 11 additions & 0 deletions other/travis/formatting-script
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

cmake -B$BUILD_DIR \
-H. \
-DFORMAT_TEST=ON \
$CMAKE_EXTRA_FLAGS

export CTEST_OUTPUT_ON_FAILURE=1

make

ctest
5 changes: 0 additions & 5 deletions toxav/toxav.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,6 @@ bool toxav_answer(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, ui

enum TOXAV_FRIEND_CALL_STATE {

/**
* The empty bit mask. None of the bits specified below are set.
*/
TOXAV_FRIEND_CALL_STATE_NONE = 0,

/**
* Set by the AV core if an error occurred on the remote end or if friend
* timed out. This is the final state after which no more state
Expand Down

0 comments on commit d65fc28

Please sign in to comment.