From bf42a3fe559b53b62db9c6363efbec612804dbe7 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 21 Sep 2018 10:22:24 +0200 Subject: Add support for running zig tests --- include/Conf.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/Conf.hpp b/include/Conf.hpp index 278acf2..951def9 100644 --- a/include/Conf.hpp +++ b/include/Conf.hpp @@ -229,7 +229,8 @@ namespace sibs cppVersion(CPPVersion::CPP14), mainProject(false), sanitize(false), - showWarnings(false) + showWarnings(false), + zigTestAllFiles(false) { cmakeDirGlobal = projectPath; cmakeDirStatic = cmakeDirGlobal; @@ -417,12 +418,16 @@ namespace sibs virtual bool isDefined(const std::string &name) const; virtual bool define(const std::string &name, const std::string &value); virtual const std::unordered_map& getDefines() const; + + virtual bool isTest() { return false; } // Get define value by name. // Return empty string if the value is empty or if the defined value doesn't exist const std::string& getDefinedValue(const std::string &name) const; + std::vector zigTestFiles; bool showWarnings; + bool zigTestAllFiles; protected: virtual void processObject(StringView name) override; virtual void processField(StringView name, const ConfigValue &value) override; @@ -474,7 +479,7 @@ namespace sibs class SibsTestConfig : public SibsConfig { public: - SibsTestConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel) : SibsConfig(_compiler, _projectPath, _optimizationLevel, true) + SibsTestConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel) : SibsConfig(_compiler, _projectPath, _optimizationLevel, false) { packageName = "test"; showWarnings = true; @@ -482,6 +487,8 @@ namespace sibs virtual ~SibsTestConfig(){} + bool isTest() override { return true; } + PackageType getPackageType() const override { return PackageType::EXECUTABLE; -- cgit v1.2.3