diff --git a/.travis.yml b/.travis.yml index beea1dfa..0d59c33f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,35 +1,110 @@ sudo: required dist: trusty language: cpp -compiler: -- gcc -- clang -addons: - apt: - packages: - - build-essential - - cmake - - doxygen - - g++ - - gcc - - clang - - graphviz - - libdb++-dev - - libdb-dev - - libgtest-dev - - libminiupnpc-dev - - libssl-dev - - libssl1.0.0 - - libunbound-dev - - libunwind8-dev - sources: - - ubuntu-toolchain-r-test -before_install: -- sudo add-apt-repository -y ppa:kojoley/boost -- sudo apt-get -q update -install: -- sudo apt-get -y install libboost-{chrono,program-options,date-time,thread,system,filesystem,regex,serialization}1.58{-dev,.0} -script: make -j2 && HAVE_DOT=YES doxygen Doxyfile + +matrix: + include: + + # + # Coveralls.io + # + - os: linux + compiler: gcc + addons: + apt: + packages: + - build-essential + - cmake + - doxygen + - g++ + - gcc + - clang + - graphviz + - libdb++-dev + - libdb-dev + - libgtest-dev + - libminiupnpc-dev + - libssl-dev + - libssl1.0.0 + - libunbound-dev + - libunwind8-dev + sources: + - ubuntu-toolchain-r-test + before_install: + - sudo add-apt-repository -y ppa:kojoley/boost + - sudo apt-get -q update + - pip install --user cpp-coveralls + install: + - sudo apt-get -y install libboost-{chrono,program-options,date-time,thread,system,filesystem,regex,serialization}1.58{-dev,.0} + script: + - make -j2 debug-test + after_success: + - travis_wait coveralls -e external -e tests -e cmake -e contrib -e translations -e utils --gcov-options '\-lp' &> /dev/null + + # + # Monero release-all (gcc) + # + - os: linux + compiler: gcc + addons: + apt: + packages: + - build-essential + - cmake + - doxygen + - g++ + - gcc + - clang + - graphviz + - libdb++-dev + - libdb-dev + - libgtest-dev + - libminiupnpc-dev + - libssl-dev + - libssl1.0.0 + - libunbound-dev + - libunwind8-dev + sources: + - ubuntu-toolchain-r-test + before_install: + - sudo add-apt-repository -y ppa:kojoley/boost + - sudo apt-get -q update + install: + - sudo apt-get -y install libboost-{chrono,program-options,date-time,thread,system,filesystem,regex,serialization}1.58{-dev,.0} + script: + - make -j2 && HAVE_DOT=YES doxygen Doxyfile + + # + # Monero release-all (clang) + # + - os: linux + compiler: clang + addons: + apt: + packages: + - build-essential + - cmake + - doxygen + - clang + - graphviz + - libdb++-dev + - libdb-dev + - libgtest-dev + - libminiupnpc-dev + - libssl-dev + - libssl1.0.0 + - libunbound-dev + - libunwind8-dev + sources: + - ubuntu-toolchain-r-test + before_install: + - sudo add-apt-repository -y ppa:kojoley/boost + - sudo apt-get -q update + install: + - sudo apt-get -y install libboost-{chrono,program-options,date-time,thread,system,filesystem,regex,serialization}1.58{-dev,.0} + script: + - make -j2 && HAVE_DOT=YES doxygen Doxyfile + notifications: email: false irc: diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bf684f6..675650b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -388,9 +388,9 @@ else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_HAS_TR1_TUPLE=0") endif() if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)) - set(DEBUG_FLAGS "-g3 -Og") + set(DEBUG_FLAGS "-g3 -Og -fprofile-arcs -ftest-coverage --coverage") else() - set(DEBUG_FLAGS "-g3 -O0") + set(DEBUG_FLAGS "-g3 -O0 -fprofile-arcs -ftest-coverage --coverage") endif() if(NOT DEFINED USE_LTO_DEFAULT) diff --git a/Makefile b/Makefile index 69d1127d..5817a8a6 100644 --- a/Makefile +++ b/Makefile @@ -35,9 +35,9 @@ cmake-debug: debug: cmake-debug cd build/debug && $(MAKE) -debug-test: debug +debug-test: mkdir -p build/debug - cd build/debug && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Debug ../.. && $(MAKE) test + cd build/debug && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Debug ../.. && $(MAKE) && $(MAKE) test debug-all: mkdir -p build/debug @@ -50,9 +50,9 @@ cmake-release: release: cmake-release cd build/release && $(MAKE) -release-test: release +release-test: mkdir -p build/release - cd build/release && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE) test + cd build/release && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE) && $(MAKE) test release-all: mkdir -p build/release diff --git a/README.md b/README.md index 4fadc9e5..eec743e7 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Copyright (c) 2014-2016, The Monero Project [![Build Status](https://travis-ci.org/monero-project/bitmonero.svg?branch=master)](https://travis-ci.org/monero-project/bitmonero) +[![Coverage Status](https://coveralls.io/repos/github/monero-project/bitmonero/badge.svg?branch=master)](https://coveralls.io/github/monero-project/bitmonero?branch=master) ## Development Resources diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d1be97af..daaa078d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -63,7 +63,9 @@ add_subdirectory(unit_tests) add_subdirectory(difficulty) add_subdirectory(hash) add_subdirectory(net_load_tests) -add_subdirectory(libwallet_api_tests) + +# Disabled until issue #895 is resolved +#add_subdirectory(libwallet_api_tests) # add_subdirectory(daemon_tests) @@ -86,5 +88,11 @@ add_test( NAME hash-target COMMAND hash-target-tests) -add_custom_target(tests DEPENDS coretests difficulty hash performance_tests core_proxy unit_tests) +# Skip the core_tests if we are running in Travis-CI because they will take too long +if (DEFINED ENV{TRAVIS}) + add_custom_target(tests DEPENDS difficulty hash performance_tests core_proxy unit_tests) +else () + add_custom_target(tests DEPENDS coretests difficulty hash performance_tests core_proxy unit_tests) +endif () + set_property(TARGET gtest gtest_main hash-target-tests tests PROPERTY FOLDER "tests")