aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-01-02 19:30:52 +0100
committerdec05eba <dec05eba@protonmail.com>2018-01-02 20:10:53 +0100
commit8ac9ddf460cc4c1b2972df1069128fb615b31042 (patch)
tree8fac0b3171f1fb2a39a10af5abff71a304100dc4 /tests
parent87a65f6913429b26e63fdee17cb8cfe93990db35 (diff)
Fix bug when using config for several platforms in one project
Diffstat (limited to 'tests')
-rw-r--r--tests/src/confTest/confTest.cpp19
-rw-r--r--tests/src/confTest/linux/x64/static/debug/libcool.a0
-rw-r--r--tests/src/confTest/linux/x64/static/release/libcool.a0
-rw-r--r--tests/src/confTest/platformConfig.conf41
4 files changed, 60 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
+}
diff --git a/tests/src/confTest/linux/x64/static/debug/libcool.a b/tests/src/confTest/linux/x64/static/debug/libcool.a
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/src/confTest/linux/x64/static/debug/libcool.a
diff --git a/tests/src/confTest/linux/x64/static/release/libcool.a b/tests/src/confTest/linux/x64/static/release/libcool.a
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/src/confTest/linux/x64/static/release/libcool.a
diff --git a/tests/src/confTest/platformConfig.conf b/tests/src/confTest/platformConfig.conf
new file mode 100644
index 0000000..e74ab76
--- /dev/null
+++ b/tests/src/confTest/platformConfig.conf
@@ -0,0 +1,41 @@
+[package]
+name = "glew"
+version = "2.1.0"
+type = "library"
+platforms = ["any"]
+
+[config.linux32]
+expose_include_dirs = ["include_linux32"]
+
+[config.linux32.static.debug]
+lib = "linux/x86/static/debug"
+
+[config.linux32.static.release]
+lib = "linux/x86/static/release"
+
+[config.linux64]
+expose_include_dirs = ["include_linux64"]
+
+[config.linux64.static.debug]
+lib = "linux/x64/static/debug"
+
+[config.linux64.static.release]
+lib = "linux/x64/static/release"
+
+[config.win32]
+expose_include_dirs = ["include_win32"]
+
+[config.win32.static.debug]
+lib = "windows/x86/static/debug"
+
+[config.win32.static.release]
+lib = "windows/x86/static/release"
+
+[config.win64]
+expose_include_dirs = ["include_win64"]
+
+[config.win64.static.debug]
+lib = "windows/x64/static/debug"
+
+[config.win64.static.release]
+lib = "windows/x64/static/release"