aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-01-03 21:17:49 +0100
committerdec05eba <dec05eba@protonmail.com>2018-01-03 21:42:51 +0100
commit8b052110d8802eda3d4d76700bde8ecc80dbf79a (patch)
tree13d9248067ba61c159e61f6083e090b26916c22f /include
parent469a67628f3eb18236ee44e948d1ae0f0e6b1a4a (diff)
Add "sibs test" command. Tests are only run when that command is invoked
Diffstat (limited to 'include')
-rw-r--r--include/Conf.hpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/include/Conf.hpp b/include/Conf.hpp
index 476e38b..de63eae 100644
--- a/include/Conf.hpp
+++ b/include/Conf.hpp
@@ -169,13 +169,14 @@ namespace sibs
class SibsConfig : public ConfigCallback
{
public:
- SibsConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel = OPT_LEV_DEBUG) :
+ SibsConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel, bool _buildTests) :
compiler(_compiler),
projectPath(_projectPath),
packageType((PackageType)-1),
optimizationLevel(_optimizationLevel),
finishedProcessing(false),
- useCmake(false)
+ useCmake(false),
+ buildTests(_buildTests)
{
cmakeDirGlobal = projectPath;
cmakeDirStatic = cmakeDirGlobal;
@@ -214,6 +215,11 @@ namespace sibs
{
return testPath;
}
+
+ void setTestPath(const FileString &testPath)
+ {
+ this->testPath = testPath;
+ }
virtual const std::vector<Dependency>& getDependencies() const
{
@@ -267,12 +273,12 @@ namespace sibs
const FileString& getCmakeDirStatic() const
{
- return cmakeDirStatic;
+ return !cmakeDirStatic.empty() ? cmakeDirStatic : cmakeDirGlobal;
}
const FileString& getCmakeDirDynamic() const
{
- return cmakeDirDynamic;
+ return !cmakeDirDynamic.empty() ? cmakeDirDynamic : cmakeDirGlobal;
}
// Get cmake args for all builds. This is args under [cmake] only
@@ -308,6 +314,11 @@ namespace sibs
return useCmake;
}
+ bool shouldBuildTests() const
+ {
+ return buildTests;
+ }
+
void setPackageType(PackageType packageType)
{
this->packageType = packageType;
@@ -351,13 +362,14 @@ namespace sibs
std::string cmakeArgsStatic;
std::string cmakeArgsDynamic;
bool useCmake;
+ bool buildTests;
bool finishedProcessing;
};
class SibsTestConfig : public SibsConfig
{
public:
- SibsTestConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel) : SibsConfig(_compiler, _projectPath, _optimizationLevel)
+ SibsTestConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel) : SibsConfig(_compiler, _projectPath, _optimizationLevel, true)
{
packageName = "test";
}