mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 17:56:13 -04:00
Enable GCov instrumentation in Debug build mode and upload results to coveralls
This commit is contained in:
parent
fb42c64bea
commit
65309d5db8
@ -14,13 +14,20 @@ addons:
|
||||
packages:
|
||||
- cppcheck
|
||||
|
||||
before_install:
|
||||
- pip install --user cpp-coveralls
|
||||
|
||||
# scripts to run before build
|
||||
before_script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_RUN_DOXYGEN=OFF ..
|
||||
- cmake -DCMAKE_BUILD_TYPE=Debug -DSQLITECPP_USE_GCOV=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_RUN_DOXYGEN=OFF ..
|
||||
|
||||
# build examples, and run tests (ie make & make test)
|
||||
script:
|
||||
- cmake --build .
|
||||
- ctest --output-on-failure
|
||||
|
||||
# publish GCov coveralls results
|
||||
after_success:
|
||||
- coveralls -e build/CMakeFiles -e examples -e googletest -e sqlite3 -e tests
|
@ -44,6 +44,15 @@ else (MSVC)
|
||||
# GCC flags
|
||||
#add_compile_options() is not supported with CMake 2.8.7 of Ubuntu 12.04 on Travis-CI
|
||||
add_definitions(-rdynamic -fstack-protector-all -Wall -Wextra -pedantic -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wshadow -Wcast-qual -Wconversion -Wlogical-op -Winline)
|
||||
if (SQLITECPP_USE_GCOV AND CMAKE_COMPILER_IS_GNUCXX)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
message (STATUS "Using GCov instrumentation")
|
||||
else ()
|
||||
message (WARNING "GCov instrumentation works best in Debug mode")
|
||||
endif ()
|
||||
add_definitions (-fprofile-arcs -ftest-coverage)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
|
||||
endif ()
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
# Clang flags
|
||||
add_definitions(-fstack-protector-all -Wall -Wextra -pedantic -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wshadow -Wcast-qual -Wconversion -Winline)
|
||||
@ -218,6 +227,8 @@ if (SQLITECPP_BUILD_TESTS)
|
||||
endif (NOT MSVC)
|
||||
|
||||
# add the subdirectory containing the CMakeLists.txt for the gtest library
|
||||
# TODO: under Linux, uses libgtest-dev if found
|
||||
# TODO: move to the new googletest Github repository
|
||||
add_subdirectory(googletest)
|
||||
include_directories("${PROJECT_SOURCE_DIR}/googletest/include")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user