aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2020-01-31 14:57:44 +0100
committerAndreas Schneider <asn@samba.org>2020-01-31 15:07:10 +0100
commit3157c038957c4a0dd29869aa5d5cccdde00efa19 (patch)
treeebcc3903338792e1a4607543f0948182fdba3323
parentc6e0341042ead637ccf6a83f13a4a993b18b17ce (diff)
downloadpam_wrapper-3157c038957c4a0dd29869aa5d5cccdde00efa19.tar.gz
pam_wrapper-3157c038957c4a0dd29869aa5d5cccdde00efa19.tar.xz
pam_wrapper-3157c038957c4a0dd29869aa5d5cccdde00efa19.zip
cmake: Do not run python tests with AddressSanitizer
It will complain about python malloc and fail. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r--tests/CMakeLists.txt37
1 files changed, 24 insertions, 13 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 60b41c8..d22c272 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -77,20 +77,31 @@ target_include_directories(test_pam_wrapper
${pam_wrapper_BINARY_DIR})
add_cmocka_test_environment(test_pam_wrapper)
-if (PYTHON2_EXECUTABLE)
- add_test(NAME
- py2pamtest_test
- COMMAND
- ${PYTHON2_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/pypamtest_test.py)
-
- add_cmocka_test_environment(py2pamtest_test)
+# Do not run python tests with AddressSanitizer
+set(RUN_PYTHON_TESTS ON)
+if (CMAKE_BUILD_TYPE)
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+ if (CMAKE_BUILD_TYPE_LOWER STREQUAL "addresssanitizer")
+ set(RUN_PYTHON_TESTS OFF)
+ endif()
endif()
-if (PYTHON3_EXECUTABLE)
- add_test(NAME
- py3pamtest_test
- COMMAND
- ${PYTHON3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/pypamtest_test.py)
+if (RUN_PYTHON_TESTS)
+ if (PYTHON2_EXECUTABLE)
+ add_test(NAME
+ py2pamtest_test
+ COMMAND
+ ${PYTHON2_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/pypamtest_test.py)
+
+ add_cmocka_test_environment(py2pamtest_test)
+ endif()
+
+ if (PYTHON3_EXECUTABLE)
+ add_test(NAME
+ py3pamtest_test
+ COMMAND
+ ${PYTHON3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/pypamtest_test.py)
- add_cmocka_test_environment(py3pamtest_test)
+ add_cmocka_test_environment(py3pamtest_test)
+ endif()
endif()