summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Brewer <jzb0012@auburn.edu>2019-01-21 14:14:33 -0600
committerMark Nunberg <mnunberg@haskalah.org>2019-02-20 05:01:09 -0500
commit93261d465f663ef81290081cc6d353d6db480bc0 (patch)
treeb23211b99bbd0456459261ddc2adb74745901f48
parentebe1657c8f76b4940c135ca26f40ffd06835c363 (diff)
Update .travis-ci.yml to use cmake
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
-rw-r--r--.travis.yml52
-rwxr-xr-xtest.sh2
2 files changed, 33 insertions, 21 deletions
diff --git a/.travis.yml b/.travis.yml
index faf2ce6..4da8186 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,12 +8,6 @@ os:
- linux
- osx
-branches:
- only:
- - staging
- - trying
- - master
-
before_script:
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then brew update; brew install redis; fi
@@ -26,20 +20,38 @@ addons:
- libc6-dev-i386
- libc6-dbg:i386
- gcc-multilib
+ - g++-multilib
- valgrind
env:
- - CFLAGS="-Werror"
- - PRE="valgrind --track-origins=yes --leak-check=full"
- - TARGET="32bit" TARGET_VARS="32bit-vars" CFLAGS="-Werror"
- - TARGET="32bit" TARGET_VARS="32bit-vars" PRE="valgrind --track-origins=yes --leak-check=full"
-
-matrix:
- exclude:
- - os: osx
- env: PRE="valgrind --track-origins=yes --leak-check=full"
-
- - os: osx
- env: TARGET="32bit" TARGET_VARS="32bit-vars" PRE="valgrind --track-origins=yes --leak-check=full"
-
-script: make $TARGET CFLAGS="$CFLAGS" && make check PRE="$PRE" && make $TARGET_VARS hiredis-example
+ - BITS="32"
+ - BITS="64"
+
+script:
+ - if [ "$TRAVIS_OS_NAME" == "osx" ]; then
+ if [ "$BITS" == "32" ]; then
+ CFLAGS="-m32 -Werror";
+ CXXFLAGS="-m32 -Werror";
+ LDFLAGS="-m32";
+ else
+ EXTRA_CMAKE_OPTS="-DENABLE_EXAMPLES:BOOL=ON";
+ CFLAGS="-Werror";
+ CXXFLAGS="-Werror";
+ fi;
+ else
+ TEST_PREFIX="valgrind --track-origins=yes --leak-check=full";
+ if [ "$BITS" == "32" ]; then
+ CFLAGS="-m32 -Werror";
+ CXXFLAGS="-m32 -Werror";
+ LDFLAGS="-m32";
+ else
+ EXTRA_CMAKE_OPTS="-DENABLE_EXAMPLES:BOOL=ON";
+ CFLAGS="-Werror";
+ CXXFLAGS="-Werror";
+ fi;
+ fi;
+ export CFLAGS CXXFLAGS LDFLAGS TEST_PREFIX EXTRA_CMAKE_OPTS
+ - mkdir build/ && cd build/
+ - cmake .. ${EXTRA_CMAKE_OPTS}
+ - make VERBOSE=1
+ - ctest -V
diff --git a/test.sh b/test.sh
index 8dce61b..9a507ae 100755
--- a/test.sh
+++ b/test.sh
@@ -22,4 +22,4 @@ bind 127.0.0.1
unixsocket ${SOCK_FILE}
EOF
-./hiredis-test -h 127.0.0.1 -p ${REDIS_PORT} -s ${SOCK_FILE}
+${TEST_PREFIX:-} ./hiredis-test -h 127.0.0.1 -p ${REDIS_PORT} -s ${SOCK_FILE}