mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-05 02:06:02 -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:
|
packages:
|
||||||
- cppcheck
|
- cppcheck
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- pip install --user cpp-coveralls
|
||||||
|
|
||||||
# scripts to run before build
|
# scripts to run before build
|
||||||
before_script:
|
before_script:
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd 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)
|
# build examples, and run tests (ie make & make test)
|
||||||
script:
|
script:
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
- ctest --output-on-failure
|
- 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
|
# GCC flags
|
||||||
#add_compile_options() is not supported with CMake 2.8.7 of Ubuntu 12.04 on Travis-CI
|
#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)
|
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")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
# Clang flags
|
# 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)
|
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)
|
endif (NOT MSVC)
|
||||||
|
|
||||||
# add the subdirectory containing the CMakeLists.txt for the gtest library
|
# 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)
|
add_subdirectory(googletest)
|
||||||
include_directories("${PROJECT_SOURCE_DIR}/googletest/include")
|
include_directories("${PROJECT_SOURCE_DIR}/googletest/include")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user