diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-01-02 19:30:52 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-01-02 20:10:53 +0100 |
commit | 8ac9ddf460cc4c1b2972df1069128fb615b31042 (patch) | |
tree | 8fac0b3171f1fb2a39a10af5abff71a304100dc4 /tests/src/confTest/confTest.cpp | |
parent | 87a65f6913429b26e63fdee17cb8cfe93990db35 (diff) |
Fix bug when using config for several platforms in one project
Diffstat (limited to 'tests/src/confTest/confTest.cpp')
-rw-r--r-- | tests/src/confTest/confTest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/src/confTest/confTest.cpp b/tests/src/confTest/confTest.cpp index a32f2ae..94cdb11 100644 --- a/tests/src/confTest/confTest.cpp +++ b/tests/src/confTest/confTest.cpp @@ -55,3 +55,22 @@ TEST_CASE("parse config - invalid field") REQUIRE(result.isErr()); REQUIRE(result.getErrMsg() == "Invalid field \"invalidField\" under object \"package\""); } + +TEST_CASE("parse config - use different config for different platforms") +{ + SibsConfig sibsConfig(Compiler::GCC, TINYDIR_STRING("tests/src/confTest")); + Result<bool> result = Config::readFromFile(TINYDIR_STRING("tests/src/confTest/platformConfig.conf"), sibsConfig); + if(result.isErr()) + { + fprintf(stderr, "%s", result.getErrMsg().c_str()); + exit(1); + } + + #if OS_TYPE == OS_TYPE_LINUX and defined(SIBS_ENV_64BIT) + #ifdef DEBUG + REQUIRE(sibsConfig.getDebugStaticLibs()[0] == TINYDIR_STRING("tests/src/confTest/linux/x64/static/debug/libcool.a")); + #else + REQUIRE(sibsConfig.getDebugStaticLibs()[0] == TINYDIR_STRING("tests/src/confTest/linux/x64/static/release/libcool.a")); + #endif + #endif +} |