Skip to content

Commit

Permalink
Run tests under asan and ubsan
Browse files Browse the repository at this point in the history
  • Loading branch information
hivert committed Oct 23, 2023
1 parent 3846007 commit 0a84b33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ foreach (intrin ${hpcombi_intrinsics})
endif()
endforeach()

add_compile_options(-mavx -mtune=native -funroll-loops -flax-vector-conversions)
add_compile_options(-mavx -mtune=native -funroll-loops -flax-vector-conversions -fsanitize=undefined -fsanitize=address)

###################
# Project Structure
Expand Down
6 changes: 4 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,19 @@ include_directories(

add_definitions (-DBOOST_TEST_DYN_LINK)

SET(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address")

set(test_src
test_epu.cpp test_perm16.cpp test_perm_all.cpp test_bmat8.cpp)
foreach(f ${test_src})
get_filename_component(testName ${f} NAME_WE)
add_executable (${testName} ${f})
target_link_libraries(${testName} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} )
target_link_libraries(${testName} asan ubsan ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
endforeach(f)

# Test for multiple inclusions
add_executable (test_mincl test_mincl.cpp test_mincl0.cpp test_mincl1.cpp)
target_link_libraries(test_mincl ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} )
target_link_libraries(test_mincl asan ubsan ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (TestEPU test_epu)
add_test (TestPerm16 test_perm16)
Expand Down

0 comments on commit 0a84b33

Please sign in to comment.