diff options
author | Lukáš Hejl <hejl.lukas@gmail.com> | 2022-02-09 15:22:19 +0300 |
---|---|---|
committer | Lukáš Hejl <hejl.lukas@gmail.com> | 2022-02-09 15:43:51 +0300 |
commit | 9b9f93ca0710a4fccd91816c8a05026f574b6640 (patch) | |
tree | 9cf9811c42d25d0db6aad353da257c4f2afde256 | |
parent | d52807ccaf4dab0d45305b64fc7d5e65c4294fe3 (diff) |
Make unit test 'fff_print_tests' to pass when a memory leak is detected.
This is just for fixing builds from the stable branch, the master branch doesn't need it.
-rw-r--r-- | tests/fff_print/fff_print_tests.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/fff_print/fff_print_tests.cpp b/tests/fff_print/fff_print_tests.cpp index 46358e5eb..cbdb2b12b 100644 --- a/tests/fff_print/fff_print_tests.cpp +++ b/tests/fff_print/fff_print_tests.cpp @@ -1,3 +1,18 @@ #include <catch_main.hpp> #include "libslic3r/libslic3r.h" + +// __has_feature() is used later for Clang, this is for compatibility with other compilers (such as GCC and MSVC) +#ifndef __has_feature +# define __has_feature(x) 0 +#endif + +// Print reports about memory leaks but exit with zero exit code when any memory leaks is found to make unit tests pass. +// After merging the stable branch (2.4.1) with the master branch, this should be deleted. +#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) +extern "C" { + const char *__lsan_default_options() { + return "exitcode=0"; + } +} +#endif
\ No newline at end of file |