mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 17:56:13 -04:00
Fix test coverage by using gcov '-lp' options
NOTE: it would be good to also be able to keep unused inline functions, but there is a problem between gcc 4.8 and -fkeep-inline-functions
This commit is contained in:
parent
435d62e85b
commit
50501a41e2
@ -17,7 +17,7 @@ addons:
|
|||||||
- cppcheck
|
- cppcheck
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- pip install --user cpp-coveralls
|
- if [[ "$CXX" == "g++" ]]; then pip install --user cpp-coveralls ; fi
|
||||||
|
|
||||||
# scripts to run before build
|
# scripts to run before build
|
||||||
before_script:
|
before_script:
|
||||||
@ -28,8 +28,8 @@ before_script:
|
|||||||
# 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 --verbose --output-on-failure
|
||||||
|
|
||||||
# publish GCov coveralls results
|
# generate and publish GCov coveralls results
|
||||||
after_success:
|
after_success:
|
||||||
- if [[ "$CXX" == "g++" ]]; then coveralls --root .. -e examples -e googletest -e sqlite3 -e tests -E ".*feature_tests.*" -E ".*CompilerId.*" ; fi
|
- if [[ "$CXX" == "g++" ]]; then coveralls --root .. -e examples -e googletest -e sqlite3 -e tests -E ".*feature_tests.*" -E ".*CompilerId.*" --gcov-options '\-lp' ; fi
|
||||||
|
@ -38,8 +38,8 @@ else (MSVC)
|
|||||||
else ()
|
else ()
|
||||||
message (WARNING "GCov instrumentation works best in Debug mode")
|
message (WARNING "GCov instrumentation works best in Debug mode")
|
||||||
endif ()
|
endif ()
|
||||||
add_compile_options (-fprofile-arcs -ftest-coverage)
|
add_compile_options (-coverage) # NOTE would be usefull but not working with current google test and gcc 4.8 -fkeep-inline-functions
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -coverage")
|
||||||
endif ()
|
endif ()
|
||||||
endif (CMAKE_COMPILER_IS_GNUCXX)
|
endif (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
endif (MSVC)
|
endif (MSVC)
|
||||||
@ -47,6 +47,25 @@ endif (MSVC)
|
|||||||
set(CPPLINT_ARG_VERBOSE "--verbose=3")
|
set(CPPLINT_ARG_VERBOSE "--verbose=3")
|
||||||
set(CPPLINT_ARG_LINELENGTH "--linelength=120")
|
set(CPPLINT_ARG_LINELENGTH "--linelength=120")
|
||||||
|
|
||||||
|
# Print CXX FLAGS
|
||||||
|
message (STATUS "CMAKE_CXX_FLAGS '${CMAKE_CXX_FLAGS}'")
|
||||||
|
if (MSVC)
|
||||||
|
message (STATUS "CMAKE_CXX_FLAGS_DEBUG '${CMAKE_CXX_FLAGS_DEBUG}'")
|
||||||
|
message (STATUS "CMAKE_CXX_FLAGS_RELEASE '${CMAKE_CXX_FLAGS_RELEASE}'")
|
||||||
|
message (STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO '${CMAKE_CXX_FLAGS_RELWITHDEBINFO}'")
|
||||||
|
message (STATUS "CMAKE_CXX_FLAGS_MINSIZEREL '${CMAKE_CXX_FLAGS_MINSIZEREL}'")
|
||||||
|
else (NOT MSVC)
|
||||||
|
if (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||||
|
message (STATUS "CMAKE_CXX_FLAGS_DEBUG '${CMAKE_CXX_FLAGS_DEBUG}'")
|
||||||
|
elseif (CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
|
||||||
|
message (STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO '${CMAKE_CXX_FLAGS_RELWITHDEBINFO}'")
|
||||||
|
elseif (CMAKE_BUILD_TYPE STREQUAL MinSizeRel)
|
||||||
|
message (STATUS "CMAKE_CXX_FLAGS_MINSIZEREL '${CMAKE_CXX_FLAGS_MINSIZEREL}'")
|
||||||
|
else ()
|
||||||
|
message (STATUS "CMAKE_CXX_FLAGS_RELEASE '${CMAKE_CXX_FLAGS_RELEASE}'")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
# Options relative to SQLite and SQLiteC++ functions
|
# Options relative to SQLite and SQLiteC++ functions
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user