Skip to content

Commit a395ce8

Browse files
Charlie FraschCharlie Frasch
authored andcommitted
WIP
1 parent 5ea0aa5 commit a395ce8

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ elseif(buildDir STREQUAL "debug")
1313
else()
1414
set(buildType Debug)
1515
endif()
16-
1716
if(NOT CMAKE_BUILD_TYPE)
1817
set(CMAKE_BUILD_TYPE ${buildType})
1918
endif()
2019

21-
# if(CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo OR CMAKE_BUILD_TYPE STREQUAL Release )
22-
# endif()
2320

2421
set(CMAKE_CXX_STANDARD 23)
2522
set(CMAKE_CXX_STANDARD_REQUIRED true)
@@ -71,7 +68,7 @@ target_link_libraries(fifo4.tsan PRIVATE pthread tsan)
7168
include(GoogleTest)
7269
enable_testing()
7370

74-
add_executable(unitTests sanitizers.cpp unitTests.cpp)
71+
add_executable(unitTests unitTests.cpp)
7572
target_compile_options(unitTests PRIVATE -fsanitize=undefined -fsanitize=address)
7673
target_link_libraries(unitTests PRIVATE asan ubsan gtest gtest_main)
7774
target_link_options(unitTests PRIVATE -fsanitize=undefined -fsanitize=address)

sanitizers.cpp

Lines changed: 0 additions & 13 deletions
This file was deleted.

unitTests.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@
88

99
#include <type_traits>
1010

11+
extern "C" {
12+
void __ubsan_on_report() {
13+
FAIL() << "Encountered an undefined behavior sanitizer error";
14+
}
15+
void __asan_on_error() {
16+
FAIL() << "Encountered an address sanitizer error";
17+
}
18+
void __tsan_on_report() {
19+
FAIL() << "Encountered a thread sanitizer error";
20+
}
21+
} // extern "C"
22+
//
1123

1224
template<typename FifoT>
1325
class FifoTest : public testing::Test {

0 commit comments

Comments
 (0)