From 444b5725b125e5154a571a1542cbb5a7ca58e29b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 4 Jul 2020 20:07:20 +0200 Subject: Fix sanitizers (and tests) by allowing to specify which sanitizer to use. Its not possible to use all of them at the same time --- include/Conf.hpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/Conf.hpp b/include/Conf.hpp index a854552..2ec3148 100644 --- a/include/Conf.hpp +++ b/include/Conf.hpp @@ -200,6 +200,15 @@ namespace sibs bool directoryToIgnore(const FileString &dir, const std::vector &ignoreDirList); bool isProjectNameValid(const std::string &projectName); + enum class Sanitize { + NONE, + ADDRESS, + UNDEFINED, + LEAK + }; + + const Sanitize SANITIZE_INVALID = (Sanitize)-1; + class SibsConfig : public ConfigCallback { public: @@ -214,7 +223,7 @@ namespace sibs cVersion(CVersion::C11), cppVersion(CPPVersion::CPP14), mainProject(false), - sanitize(false), + sanitize(Sanitize::NONE), showWarnings(false), errorOnWarning(false), zigTestAllFiles(false), @@ -396,12 +405,12 @@ namespace sibs this->mainProject = mainProject; } - bool getSanitize() const + Sanitize getSanitize() const { return sanitize; } - void setSanitize(bool sanitize) + void setSanitize(Sanitize sanitize) { this->sanitize = sanitize; } @@ -472,7 +481,7 @@ namespace sibs bool buildTests; bool finishedProcessing; bool mainProject; - bool sanitize; + Sanitize sanitize; }; class SibsTestConfig : public SibsConfig -- cgit v1.2.3