From 1f6ee990275f412d4cc84483051fd549710da634 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 1 Jan 2018 09:40:08 +0100 Subject: Add config parsing for cmake cmake has not integrated yet, but it will parse... Add test script to easily run tests --- tests/src/confTest/confTest.cpp | 11 +++++++++++ tests/src/confTest/validProject.conf | 12 ++++++++++++ 2 files changed, 23 insertions(+) (limited to 'tests') diff --git a/tests/src/confTest/confTest.cpp b/tests/src/confTest/confTest.cpp index 17b5995..e508e84 100644 --- a/tests/src/confTest/confTest.cpp +++ b/tests/src/confTest/confTest.cpp @@ -27,6 +27,17 @@ TEST_CASE("parse config") const auto &catch2Dependency = sibsConfig.getDependencies()[1]; REQUIRE(catch2Dependency.name == "catch2"); REQUIRE(catch2Dependency.version == "1.0.0"); + + REQUIRE(sibsConfig.shouldUseCmake()); + + REQUIRE(sibsConfig.getCmakeDir() == TINYDIR_STRING("tests/src/confTest/cmakeGlobal")); + REQUIRE(sibsConfig.getCmakeArgs() == "\"-DCMAKE_BUILD_TYPE=Debug\" \"-DENTITYX_RUN_BENCHMARKS=0\""); + + REQUIRE(sibsConfig.getCmakeDirStatic() == TINYDIR_STRING("tests/src/confTest/cmakeStatic")); + REQUIRE(sibsConfig.getCmakeArgsStatic() == "\"-DCMAKE_BUILD_TYPE=Debug\" \"-DENTITYX_RUN_BENCHMARKS=0\" \"-DENTITYX_BUILD_TESTING=0\""); + + REQUIRE(sibsConfig.getCmakeDirDynamic() == TINYDIR_STRING("tests/src/confTest/cmakeDynamic")); + REQUIRE(sibsConfig.getCmakeArgsDynamic() == "\"-DCMAKE_BUILD_TYPE=Debug\" \"-DENTITYX_RUN_BENCHMARKS=0\" \"-DENTITYX_BUILD_TESTING=0\" \"-DENTITYX_BUILD_SHARED=1\""); } TEST_CASE("parse config - invalid object") diff --git a/tests/src/confTest/validProject.conf b/tests/src/confTest/validProject.conf index de5112d..eab258b 100644 --- a/tests/src/confTest/validProject.conf +++ b/tests/src/confTest/validProject.conf @@ -7,3 +7,15 @@ platforms = ["linux64", "win64"] [dependencies] xxhash = "0.1.0" catch2 = "1.0.0" + +[cmake] +dir = "cmakeGlobal" +args = ["ENTITYX_RUN_BENCHMARKS=0"] + +[cmake.static] +dir = "cmakeStatic" +args = ["ENTITYX_BUILD_TESTING=0"] + +[cmake.dynamic] +dir = "cmakeDynamic" +args = ["ENTITYX_BUILD_TESTING=0", "ENTITYX_BUILD_SHARED=1"] -- cgit v1.2.3