file(GLOB_RECURSE TESTING_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
set(TESTING_ROOT ${CMAKE_CURRENT_BINARY_DIR})
+set(SOURCES_ROOT ${CMAKE_SOURCE_DIR})
set_source_files_properties(main.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
configure_file(conf.h.in conf.h @ONLY)
add_executable(runtests ${TESTING_SRC})
#cmakedefine HAVE_TBB 1
#cmakedefine HAVE_WAITID_NOWAIT 1
+#cmakedefine SOURCES_ROOT "@SOURCES_ROOT@"
#cmakedefine TESTING_ROOT "@TESTING_ROOT@"
#cmakedefine MEMCACHED_BINARY getenv_else("MEMCACHED_BINARY", "@MEMCACHED_BINARY@")
#include "mem_config.h"
+#include "test/conf.h"
#include "test/lib/env.hpp"
#include "test/lib/random.hpp"
#include <cstdlib>
"verify_asan_link_order=1," \
"abort_on_error=0," \
""
+# define LSAN_OPTIONS \
+ "suppressions=" SOURCES_ROOT "/test/LeakSanitizer.suppressions," \
+ ""
static inline void setup_asan(char **argv) {
const auto set = getenv("ASAN_OPTIONS");
perror("exec()");
}
}
+static inline void setup_lsan(char **argv) {
+ const auto set = getenv("LSAN_OPTIONS");
+
+ if (!set || !*set) {
+ SET_ENV_EX(lsan, "LSAN_OPTIONS", LSAN_OPTIONS, 0);
+ execvp(argv[0], argv);
+ perror("exec()");
+ }
+}
#else
# define setup_asan(a) (void) a
+# define setup_lsan(a) (void) a
#endif
#if LIBMEMCACHED_WITH_SASL_SUPPORT
setup_signals();
setup_random();
setup_asan(*argv);
+ setup_lsan(*argv);
setup_sasl();
return 0;