diff --git a/.build.mk b/.build.mk new file mode 100644 index 0000000000000000000000000000000000000000..b10ef10c4e24c7d8cab85f06a3fa3e5f2d0f2297 --- /dev/null +++ b/.build.mk @@ -0,0 +1,31 @@ +# +# Travis rules +# + +travis_deps_linux: + sudo apt-get update > /dev/null + sudo apt-get -q -y install binutils-dev python-daemon python-yaml + sudo pip install six==1.9.0 + sudo pip install gevent + +travis_test_linux: travis_deps_linux + cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo + make -j8 + cd test && /usr/bin/python test-run.py + +travis_coverage: travis_deps_linux + cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_GCOV=ON + make -j8 + # Enable --long tests for coverage + cd test && /usr/bin/python test-run.py --long + +travis_deps_osx: + brew install openssl + sudo pip install python-daemon PyYAML + sudo pip install six==1.9.0 + sudo pip install gevent + +travis_test_osx: travis_deps_osx + cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo + make -j8 + cd test && python test-run.py diff --git a/.gitignore b/.gitignore index 0ce8ccf383bc95249cd027cde49ee41fec7c6955..87a97d81008ac65b981c6625a7ffd9ef7e3e899f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ _CPack_Packages *.gcno *.gcda *.gcov +coverage/ coverage.info *.o *.reject diff --git a/.travis.yml b/.travis.yml index ffab6c7af858274936be8fb105cf7e092202b4d9..11de166fafbfea515aeacdc8066e9ed6a85c2d4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ compiler: env: matrix: + - PACK=none + - PACK=coverage - OS=el DIST=6 PACK=rpm - OS=el DIST=7 PACK=rpm - OS=fedora DIST=22 PACK=rpm @@ -26,10 +28,10 @@ env: - OS=debian DIST=wheezy PACK=deb - OS=debian DIST=stretch PACK=deb - OS=debian DIST=sid PACK=deb - - PACK=none matrix: allow_failures: + - env: PACK=coverage - env: OS=el DIST=6 PACK=rpm - env: OS=el DIST=7 PACK=rpm - env: OS=fedora DIST=22 PACK=rpm @@ -45,6 +47,8 @@ matrix: - env: OS=debian DIST=sid PACK=deb exclude: + - env: PACK=coverage + compiler: clang - env: OS=el DIST=6 PACK=rpm compiler: clang - env: OS=el DIST=7 PACK=rpm @@ -71,6 +75,8 @@ matrix: compiler: clang - env: OS=debian DIST=sid PACK=deb compiler: clang + - env: PACK=coverage + os: osx - env: OS=el DIST=6 PACK=rpm os: osx - env: OS=el DIST=7 PACK=rpm diff --git a/extra/travis/build_linux.sh b/extra/travis/build_linux.sh deleted file mode 100755 index 9ada142ef194debbc14266dcc1043cafe84388dc..0000000000000000000000000000000000000000 --- a/extra/travis/build_linux.sh +++ /dev/null @@ -1,37 +0,0 @@ -sudo apt-get update > /dev/null -sudo apt-get -q -y install binutils-dev python-daemon python-yaml -sudo apt-get -q -y install libmysqlclient-dev libpq-dev postgresql-server-dev-all -sudo pip install six==1.9.0 -sudo pip install gevent -sudo pip install geventconnpool -CMAKE_OPTS="" -if [ -n "${COVERALLS_TOKEN}" ] && [ "${CC}" = "gcc" ]; then - echo "Code coverage analysis is enabled" - sudo apt-get -q -y install lcov - gem install coveralls-lcov - CMAKE_OPTS="-DENABLE_GCOV=ON" -else - COVERALLS_TOKEN="" -fi -cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_OPTS} -make -j8 - -cd test -/usr/bin/python test-run.py -[ $? -eq 0 ] || exit $? -cd .. - -if [ -n "${COVERALLS_TOKEN}" ]; then - echo "Collecting code coverage information" - # http://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/ - LCOV_FILE="$(pwd)/coverage.info" - # Capture coverage info - lcov --directory src/ --capture --output-file ${LCOV_FILE}.tmp - # Filter out system, test and third-party code - lcov --remove ${LCOV_FILE}.tmp 'tests/*' 'third_party/*' '/usr/*' \ - --output-file ${LCOV_FILE} - rm -f ${LCOV_FILE}.tmp - echo "Exporting code coverage information to coveralls.io" - # Upload to coveralls.io - coveralls-lcov --repo-token ${COVERALLS_TOKEN} ${LCOV_FILE} -fi diff --git a/extra/travis/build_osx.sh b/extra/travis/build_osx.sh deleted file mode 100755 index 2826fbddf5df4d6a41df81bc90930c6414138f11..0000000000000000000000000000000000000000 --- a/extra/travis/build_osx.sh +++ /dev/null @@ -1,8 +0,0 @@ -brew install openssl -sudo pip install python-daemon PyYAML -sudo pip install six==1.9.0 -sudo pip install gevent -sudo pip install geventconnpool -cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -make -j8 -cd test && python test-run.py diff --git a/test.sh b/test.sh deleted file mode 100644 index 66947e633532a1cc3140bd1e59df597f6a43b93a..0000000000000000000000000000000000000000 --- a/test.sh +++ /dev/null @@ -1 +0,0 @@ -bash ./extra/travis/build_$TRAVIS_OS_NAME.sh