testing: improve sanitizer handling
[awesomized/libmemcached] / testing / main.cpp
index 8b945286fafe5c0e1dd8a22720c17eb86739f8dd..b24f727b7e26a348bf1de944f4c0dcbfec071c44 100644 (file)
@@ -1,2 +1,15 @@
-#define CATCH_CONFIG_MAIN
+#define CATCH_CONFIG_RUNNER
 #include "lib/catch.hpp"
+#include <cstdlib>
+
+int main(int argc, char *argv[]) {
+#if HAVE_ASAN
+# if HAVE_SETENV
+  setenv("ASAN_OPTIONS", "halt_on_error=0", 0);
+# else
+  char env[] = "ASAN_OPTIONS=halt_on_error=0";
+  putenv(env);
+# endif
+#endif
+  return Catch::Session().run(argc, argv);
+}