diff options
author | iphydf <iphydf@users.noreply.github.com> | 2017-01-04 21:15:48 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2017-01-05 12:34:52 +0000 |
commit | 0a61d1108547513211560e66809479cab5082ede (patch) | |
tree | 44f436d06e036283f8624d202d7abf3cfd8d7842 /other/travis/toxcore-script | |
parent | 69e1b99b1d29f6089334a8af8e7f87666fe8bb9e (diff) |
Test a few cmake option combinations before the build.
This takes a few seconds but allows us to cover cases that aren't checked
often.
Diffstat (limited to 'other/travis/toxcore-script')
-rwxr-xr-x | other/travis/toxcore-script | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/other/travis/toxcore-script b/other/travis/toxcore-script index d25dc135..9b81b863 100755 --- a/other/travis/toxcore-script +++ b/other/travis/toxcore-script | |||
@@ -3,9 +3,26 @@ | |||
3 | # Enable test coverage recording. | 3 | # Enable test coverage recording. |
4 | export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" | 4 | export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" |
5 | 5 | ||
6 | set_opt() { | ||
7 | opts="$opts -D$1="`expr ON \& \( $i % 2 \) \| OFF` | ||
8 | set +e # result can be 0 | ||
9 | i=`expr $i / 2` | ||
10 | set -e | ||
11 | } | ||
12 | |||
13 | # Try some combinations of cmake options. | ||
14 | for i in `seq 0 7`; do | ||
15 | set +x | ||
16 | opts="$CMAKE_EXTRA_FLAGS -DWARNINGS=OFF" | ||
17 | set_opt STRICT_ABI | ||
18 | set_opt ENABLE_STATIC | ||
19 | set_opt ENABLE_SHARED | ||
20 | set -x | ||
21 | RUN $CMAKE -B$BUILD_DIR -H. $opts | ||
22 | rm -rf $BUILD_DIR | ||
23 | done | ||
24 | |||
6 | # Build toxcore and run tests. | 25 | # Build toxcore and run tests. |
7 | # TODO(iphydf): Enable ASAN. It currently has some bad interactions with gcov, | ||
8 | # so it's disabled on Travis. | ||
9 | RUN $CMAKE \ | 26 | RUN $CMAKE \ |
10 | -B$BUILD_DIR \ | 27 | -B$BUILD_DIR \ |
11 | -H. \ | 28 | -H. \ |