Skip to content

Commit

Permalink
Add sanitizers support
Browse files Browse the repository at this point in the history
  • Loading branch information
rbost committed Nov 30, 2018
1 parent 05e05cf commit baeef71
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "externals/CMake-codecov"]
path = externals/CMake-codecov
url = https://github.com/rbost/CMake-codecov.git
[submodule "externals/sanitizers-cmake"]
path = externals/sanitizers-cmake
url = https://github.com/arsenm/sanitizers-cmake.git
28 changes: 24 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.1)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/CMake-codecov/cmake")
list(
APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/CMake-codecov/cmake"
)
list(
APPEND
CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/sanitizers-cmake/cmake"
)

# Build in Debug mode by default
set(default_build_type "Debug")
Expand All @@ -22,7 +28,17 @@ include(CheckCXXCompilerFlag)

# enable code coverage
find_package(codecov)
list(APPEND LCOV_REMOVE_PATTERNS '${CMAKE_CURRENT_SOURCE_DIR}/test/*' '${CMAKE_CURRENT_SOURCE_DIR}/externals/*' '${CMAKE_CURRENT_SOURCE_DIR}/third_party/*' '*.pb.h')
list(
APPEND
LCOV_REMOVE_PATTERNS
'${CMAKE_CURRENT_SOURCE_DIR}/test/*'
'${CMAKE_CURRENT_SOURCE_DIR}/externals/*'
'${CMAKE_CURRENT_SOURCE_DIR}/third_party/*'
'*.pb.h'
)

# Find Sanitizers
find_package(Sanitizers)

# We use CMake's integrated testing features
enable_testing()
Expand Down Expand Up @@ -71,14 +87,18 @@ add_subdirectory(third_party/db-parser/src)
add_subdirectory(lib)
add_coverage(schemes)
add_coverage(runners)

add_sanitizers(schemes)
add_sanitizers(runners)

add_subdirectory(src)
foreach(runner IN LISTS ${runner_bins})
add_sanitizers(runner)
endforeach(runner IN LISTS ${runner_bins})

# Build googletest for the tests
add_subdirectory(externals/googletest)
add_subdirectory(test)
add_coverage(check)
add_sanitizers(check)

coverage_evaluate()

1 change: 1 addition & 0 deletions externals/sanitizers-cmake
Submodule sanitizers-cmake added at 99e159
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ add_executable(diana_client diana_client.cpp)
target_link_libraries(diana_client OpenSSE::runners)
add_executable(diana_server diana_server.cpp)
target_link_libraries(diana_server OpenSSE::runners)

set(runner_bins sophos_client sophos_server diana_client diana_server PARENT_SCOPE)

0 comments on commit baeef71

Please sign in to comment.