Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for code coverage instrumentalisation #1946

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmake/config/compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ else()
target_compile_options( eve_test INTERFACE -std=c++20 -Werror -Wall -Wpedantic -Wextra -fdiagnostics-color=always -Wno-array-bounds -Wno-stringop-overread -Wno-stringop-overflow)
endif()

if(EVE_ENABLE_COVERAGE)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
message(FATAL_ERROR "EVE coverage profiling is not supported on MSVC")
else()
target_compile_options( eve_test INTERFACE --coverage -fprofile-update=atomic )
target_link_options( eve_test INTERFACE --coverage -fprofile-update=atomic )
endif()
endif()

target_include_directories( eve_test INTERFACE
${PROJECT_SOURCE_DIR}/test
${PROJECT_SOURCE_DIR}/examples
Expand Down
8 changes: 8 additions & 0 deletions cmake/config/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ option( EVE_BUILD_TEST "Build unit tests for eve"
option( EVE_BUILD_RANDOM "Build random precision tests for eve" OFF )
option( EVE_BUILD_BENCHMARKS "Build benchmarks for eve" OFF )
option( EVE_BUILD_DOCUMENTATION "Compile Doxygen documentation" ON )
option( EVE_ENABLE_COVERAGE "Enable code coverage" OFF )

if( EVE_USE_PCH )
set(pch_status "ON ")
Expand All @@ -37,10 +38,17 @@ else()
set(bench_status "OFF")
endif()

if( EVE_ENABLE_COVERAGE )
set(coverage_status "ON ")
else()
set(coverage_status "OFF")
endif()

message( STATUS "[eve] Building ${CMAKE_BUILD_TYPE} mode with: ${CMAKE_CXX_FLAGS}" )
message( STATUS "[eve] Use PCH : ${pch_status} (via EVE_USE_PCH)" )
message( STATUS "[eve] Unit tests : ${test_status} (via EVE_BUILD_TEST)" )
message( STATUS "[eve] Random tests : ${random_status} (via EVE_BUILD_RANDOM)" )
message( STATUS "[eve] Benchmarks tests : ${bench_status} (via EVE_BUILD_BENCHMARKS)" )
message( STATUS "[eve] Code Coverage : ${coverage_status} (via EVE_ENABLE_COVERAGE)" )

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1 change: 1 addition & 0 deletions include/eve/arch/cpu/wide.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <eve/module/core/regular/mul.hpp>
#include <eve/module/core/regular/div.hpp>
#include <eve/module/core/regular/minus.hpp>
#include <eve/module/core/regular/shl.hpp>
#include <eve/memory/soa_ptr.hpp>
#include <eve/traits/product_type.hpp>

Expand Down