Merge pull request #1010

3398515 cmake: exclude tests from running (redfish)
e374ae7 cmake: option+target for profiling for coverage (redfish)
This commit is contained in:
Riccardo Spagni 2016-09-01 20:01:16 +02:00
commit 59b7f51766
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
4 changed files with 24 additions and 16 deletions

View File

@ -36,8 +36,11 @@ matrix:
- pip install --user cpp-coveralls - pip install --user cpp-coveralls
install: install:
- sudo apt-get -y install libboost-{chrono,program-options,date-time,thread,system,filesystem,regex,serialization}1.58{-dev,.0} - sudo apt-get -y install libboost-{chrono,program-options,date-time,thread,system,filesystem,regex,serialization}1.58{-dev,.0}
env:
# exclude long-running and failing tests (#895)
- ARGS=" -E 'coretests|libwallet_api_tests' "
script: script:
- make -j2 debug-test - make -j2 coverage
after_success: after_success:
- travis_wait coveralls -e external -e tests -e cmake -e contrib -e translations -e utils --gcov-options '\-lp' &> /dev/null - travis_wait coveralls -e external -e tests -e cmake -e contrib -e translations -e utils --gcov-options '\-lp' &> /dev/null

View File

@ -358,8 +358,15 @@ else()
set(STATIC_ASSERT_FLAG "-Dstatic_assert=_Static_assert") set(STATIC_ASSERT_FLAG "-Dstatic_assert=_Static_assert")
endif() endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG}") option(COVERAGE "Enable profiling for test coverage report" 0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG}")
if(COVERAGE)
message(STATUS "Building with profiling for test coverage report")
set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage --coverage")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS}")
# With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that # With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that
# is fixed in the code (Issue #847), force compiler to be conservative. # is fixed in the code (Issue #847), force compiler to be conservative.
@ -459,10 +466,12 @@ else()
if(APPLE) if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_HAS_TR1_TUPLE=0") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_HAS_TR1_TUPLE=0")
endif() endif()
set(DEBUG_FLAGS "-g3")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)) if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8))
set(DEBUG_FLAGS "-g3 -Og -fprofile-arcs -ftest-coverage --coverage") set(DEBUG_FLAGS "${DEBUG_FLAGS} -Og ")
else() else()
set(DEBUG_FLAGS "-g3 -O0 -fprofile-arcs -ftest-coverage --coverage") set(DEBUG_FLAGS "${DEBUG_FLAGS} -O0 ")
endif() endif()
if(NOT DEFINED USE_LTO_DEFAULT) if(NOT DEFINED USE_LTO_DEFAULT)

View File

@ -58,6 +58,10 @@ release-all:
mkdir -p build/release mkdir -p build/release
cd build/release && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE) cd build/release && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE)
coverage:
mkdir -p build/debug
cd build/debug && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Debug -D COVERAGE=ON ../.. && $(MAKE) && $(MAKE) test
release-static-arm6: release-static-arm6:
mkdir -p build/release mkdir -p build/release
cd build/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv6zk" -D STATIC=ON -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE) cd build/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv6zk" -D STATIC=ON -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE)

View File

@ -62,9 +62,7 @@ else ()
FOLDER "${folder}") FOLDER "${folder}")
endif () endif ()
if (NOT DEFINED ENV{TRAVIS}) add_subdirectory(core_tests)
add_subdirectory(core_tests)
endif ()
add_subdirectory(crypto) add_subdirectory(crypto)
add_subdirectory(functional_tests) add_subdirectory(functional_tests)
add_subdirectory(performance_tests) add_subdirectory(performance_tests)
@ -73,9 +71,7 @@ add_subdirectory(unit_tests)
add_subdirectory(difficulty) add_subdirectory(difficulty)
add_subdirectory(hash) add_subdirectory(hash)
add_subdirectory(net_load_tests) 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) # add_subdirectory(daemon_tests)
@ -99,16 +95,12 @@ add_test(
COMMAND hash-target-tests) COMMAND hash-target-tests)
set(enabled_tests set(enabled_tests
coretests
difficulty difficulty
hash hash
performance_tests performance_tests
core_proxy core_proxy
unit_tests) unit_tests)
# Skip the core_tests in Travis-CI because they will take too long
if (NOT DEFINED ENV{TRAVIS})
list(APPEND enabled_tests coretests)
endif()
add_custom_target(tests DEPENDS enabled_tests) add_custom_target(tests DEPENDS enabled_tests)
set_property(TARGET tests PROPERTY FOLDER "${folder}") set_property(TARGET tests PROPERTY FOLDER "${folder}")