Add tests on travis

This commit is contained in:
Konstantinos Sideris 2017-05-08 16:27:21 +03:00
parent 07405fd4ff
commit e77fb8a6e7
4 changed files with 31 additions and 1 deletions

19
.ci/linux/gtest.sh Executable file
View file

@ -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

8
.ci/linux/run-tests.sh Executable file
View file

@ -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

View file

@ -17,12 +17,15 @@ matrix:
compiler: gcc compiler: gcc
- os: linux - os: linux
compiler: clang compiler: clang
before_install:
- if [ $TRAVIS_OS_NAME == linux ]; then ./.ci/linux/gtest.sh; fi
install: install:
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install qt5; fi - 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 == 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: before_script:
- if [ $TRAVIS_OS_NAME == linux ]; then source /opt/qt58/bin/qt58-env.sh; fi - if [ $TRAVIS_OS_NAME == linux ]; then source /opt/qt58/bin/qt58-env.sh; fi
- cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release - cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release
script: script:
- make -C build -j2 - make -C build -j2
- if [ $TRAVIS_OS_NAME == linux ]; then ./.ci/linux/run-tests.sh; fi