Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
adf76e10
Commit
adf76e10
authored
Oct 20, 2015
by
Hugo Beauzée-Luyssen
Browse files
tests: Allow (t|ub|a)san to be used
parent
a007c755
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/CMakeLists.txt
View file @
adf76e10
...
...
@@ -4,6 +4,12 @@ cmake_minimum_required(VERSION 2.8)
include
(
ExternalProject
)
include
(
cpp11
)
if
(
UNIX
)
option
(
WITH_ASAN
"Build with address sanitizer"
OFF
)
option
(
WITH_TSAN
"Build with thread sanitizer"
OFF
)
option
(
WITH_UBSAN
"Build with undefined behavior sanitizer"
OFF
)
endif
()
# Fetch gtest
ExternalProject_Add
(
gtest-dependency
...
...
@@ -66,6 +72,30 @@ include_directories(${LIBVLCPP_DIR})
# Also add pthread, as gtest requires it
if
(
UNIX
)
target_link_libraries
(
unittest
"pthread"
)
if
(
${
WITH_ASAN
}
)
if
(
${
WITH_TSAN
}
OR
${
WITH_UBSAN
}
)
message
(
SEND_ERROR
"Sanitizers are mutually exclusive"
)
endif
()
add_definitions
(
"-fsanitize=address -fno-omit-frame-pointer"
)
target_link_libraries
(
unittest
"asan"
)
endif
()
if
(
${
WITH_TSAN
}
)
if
(
${
WITH_ASAN
}
OR
${
WITH_UBSAN
}
)
message
(
SEND_ERROR
"Sanitizers are mutually exclusive"
)
endif
()
add_definitions
(
"-fsanitize=thread -fno-omit-frame-pointer"
)
target_link_libraries
(
unittest
"tsan"
)
endif
()
if
(
${
WITH_UBSAN
}
)
if
(
${
WITH_ASAN
}
OR
${
WITH_TSAN
}
)
message
(
SEND_ERROR
"Sanitizers are mutually exclusive"
)
endif
()
add_definitions
(
"-fsanitize=undefined -fno-omit-frame-pointer"
)
target_link_libraries
(
unittest
"ubsan"
)
endif
()
endif
()
## Download files for parsing unit tests
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment