aboutsummaryrefslogtreecommitdiff
path: root/tests/src/confTest/confTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/confTest/confTest.cpp')
-rw-r--r--tests/src/confTest/confTest.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/src/confTest/confTest.cpp b/tests/src/confTest/confTest.cpp
index 44bcab0..f3d9e2b 100644
--- a/tests/src/confTest/confTest.cpp
+++ b/tests/src/confTest/confTest.cpp
@@ -74,3 +74,33 @@ TEST_CASE("parse config - use different config for different platforms")
#endif
#endif
}
+
+TEST_CASE("parse config - define static")
+{
+ SibsConfig sibsConfig(Compiler::GCC, TINYDIR_STRING("tests/src/confTest"), OPT_LEV_DEBUG, false);
+ Result<bool> result = Config::readFromFile(TINYDIR_STRING("tests/src/confTest/defineStatic.conf"), sibsConfig);
+ if(result.isErr())
+ {
+ fprintf(stderr, "%s", result.getErrMsg().c_str());
+ exit(1);
+ }
+
+ REQUIRE(sibsConfig.getDefinedValue("GLOBAL_DEFINE") == "1");
+ REQUIRE(sibsConfig.getDefinedValue("BUILD_STATIC") == "1");
+ REQUIRE(sibsConfig.getDefinedValue("DEFINE_TYPE") == "STATIC");
+}
+
+TEST_CASE("parse config - define dynamic")
+{
+ SibsConfig sibsConfig(Compiler::GCC, TINYDIR_STRING("tests/src/confTest"), OPT_LEV_DEBUG, false);
+ Result<bool> result = Config::readFromFile(TINYDIR_STRING("tests/src/confTest/defineDynamic.conf"), sibsConfig);
+ if(result.isErr())
+ {
+ fprintf(stderr, "%s", result.getErrMsg().c_str());
+ exit(1);
+ }
+
+ REQUIRE(sibsConfig.getDefinedValue("GLOBAL_DEFINE") == "1");
+ REQUIRE(sibsConfig.getDefinedValue("BUILD_STATIC") == "0");
+ REQUIRE(sibsConfig.getDefinedValue("DEFINE_TYPE") == "DYNAMIC");
+}