From e77fb8a6e7a77a0f3d2b816a18dc7be9e786a645 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Mon, 8 May 2017 16:27:21 +0300 Subject: [PATCH] Add tests on travis --- .ci/linux/gtest.sh | 19 +++++++++++++++++++ .ci/{linux.sh => linux/install-deps.sh} | 0 .ci/linux/run-tests.sh | 8 ++++++++ .travis.yml | 5 ++++- 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 .ci/linux/gtest.sh rename .ci/{linux.sh => linux/install-deps.sh} (100%) create mode 100755 .ci/linux/run-tests.sh diff --git a/.ci/linux/gtest.sh b/.ci/linux/gtest.sh new file mode 100755 index 00000000..8dd7084c --- /dev/null +++ b/.ci/linux/gtest.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -evx + +sudo apt-get -qq update +sudo apt-get install -y libgtest-dev +wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz +tar xf release-1.8.0.tar.gz +cd googletest-release-1.8.0 + +cmake -DBUILD_SHARED_LIBS=ON . +make +sudo cp -a googletest/include/gtest /usr/include +sudo cp -a googlemock/gtest/*.so /usr/lib/ + +sudo ldconfig -v | grep gtest + +cd $TRAVIS_BUILD_DIR + diff --git a/.ci/linux.sh b/.ci/linux/install-deps.sh similarity index 100% rename from .ci/linux.sh rename to .ci/linux/install-deps.sh diff --git a/.ci/linux/run-tests.sh b/.ci/linux/run-tests.sh new file mode 100755 index 00000000..ae0c7b77 --- /dev/null +++ b/.ci/linux/run-tests.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -evx + +cmake -DBUILD_TESTS=ON -H. -Bbuild -DCMAKE_BUILD_TYPE=Release +make -C build -j2 + +cd build && GTEST_COLOR=1 ctest --verbose diff --git a/.travis.yml b/.travis.yml index f763bec1..cdd88920 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,12 +17,15 @@ matrix: compiler: gcc - os: linux compiler: clang +before_install: + - if [ $TRAVIS_OS_NAME == linux ]; then ./.ci/linux/gtest.sh; fi install: - if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install qt5; fi - if [ $TRAVIS_OS_NAME == osx ]; then export CMAKE_PREFIX_PATH=/usr/local/opt/qt5; fi - - if [ $TRAVIS_OS_NAME == linux ]; then ./.ci/linux.sh ; fi + - if [ $TRAVIS_OS_NAME == linux ]; then ./.ci/linux/install-deps.sh; fi before_script: - if [ $TRAVIS_OS_NAME == linux ]; then source /opt/qt58/bin/qt58-env.sh; fi - cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release script: - make -C build -j2 + - if [ $TRAVIS_OS_NAME == linux ]; then ./.ci/linux/run-tests.sh; fi