aboutsummaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/confTest/confTest.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/tests/src/confTest/confTest.cpp b/tests/src/confTest/confTest.cpp
index 68e2225..c770266 100644
--- a/tests/src/confTest/confTest.cpp
+++ b/tests/src/confTest/confTest.cpp
@@ -3,6 +3,16 @@
using namespace sibs;
+static FileString arg_list_to_string(const std::vector<FileString> &args) {
+ FileString result;
+ for(const FileString &arg : args) {
+ if(!result.empty())
+ result += TINYDIR_STRING(" ");
+ result += TINYDIR_STRING("\"") + arg + TINYDIR_STRING("\"");
+ }
+ return result;
+}
+
TEST_CASE("parse config")
{
SibsConfig sibsConfig(Compiler::GCC, TINYDIR_STRING("tests/src/confTest"), OPT_LEV_DEBUG, false);
@@ -20,28 +30,28 @@ TEST_CASE("parse config")
REQUIRE(containsPlatform(sibsConfig.getPlatforms(), PLATFORM_WIN64));
REQUIRE(sibsConfig.getPackageListDependencies().size() == 2);
- for(auto *dep : sibsConfig.getPackageListDependencies())
+ for(const auto &dep : sibsConfig.getPackageListDependencies())
{
- REQUIRE(dep->getSource() == Dependency::Source::PACKAGE_LIST);
+ REQUIRE(dep.getSource() == Dependency::Source::PACKAGE_LIST);
}
- auto *xxhashDependency = sibsConfig.getPackageListDependencies()[0]->asPackageListDependency();
+ auto *xxhashDependency = sibsConfig.getPackageListDependencies()[0].asPackageListDependency();
REQUIRE(xxhashDependency->name == "xxhash");
REQUIRE(xxhashDependency->version.toString() == ">=0.1.0 and <1.0.0");
- const auto &catch2Dependency = sibsConfig.getPackageListDependencies()[1]->asPackageListDependency();
+ const auto &catch2Dependency = sibsConfig.getPackageListDependencies()[1].asPackageListDependency();
REQUIRE(catch2Dependency->name == "catch2");
REQUIRE(catch2Dependency->version.toString() == ">=1.0.0 and <2.0.0");
REQUIRE(sibsConfig.shouldUseCmake());
REQUIRE(sibsConfig.getCmakeDir() == TINYDIR_STRING("tests/src/confTest/cmakeGlobal"));
- REQUIRE(sibsConfig.getCmakeArgs() == "-G Ninja \"-DCMAKE_BUILD_TYPE=Debug\" \"-DENTITYX_RUN_BENCHMARKS=0\"");
+ REQUIRE(arg_list_to_string(sibsConfig.getCmakeArgs()) == "\"-G\" \"Ninja\" \"-DCMAKE_BUILD_TYPE=Debug\" \"-DENTITYX_RUN_BENCHMARKS=0\"");
REQUIRE(sibsConfig.getCmakeDirStatic() == TINYDIR_STRING("tests/src/confTest/cmakeStatic"));
- REQUIRE(sibsConfig.getCmakeArgsStatic() == "-G Ninja \"-DCMAKE_BUILD_TYPE=Debug\" \"-DENTITYX_RUN_BENCHMARKS=0\" \"-DENTITYX_BUILD_TESTING=0\"");
+ REQUIRE(arg_list_to_string(sibsConfig.getCmakeArgsStatic()) == "\"-G\" \"Ninja\" \"-DCMAKE_BUILD_TYPE=Debug\" \"-DENTITYX_RUN_BENCHMARKS=0\" \"-DENTITYX_BUILD_TESTING=0\"");
REQUIRE(sibsConfig.getCmakeDirDynamic() == TINYDIR_STRING("tests/src/confTest/cmakeDynamic"));
- REQUIRE(sibsConfig.getCmakeArgsDynamic() == "-G Ninja \"-DCMAKE_BUILD_TYPE=Debug\" \"-DENTITYX_RUN_BENCHMARKS=0\" \"-DENTITYX_BUILD_TESTING=0\" \"-DENTITYX_BUILD_SHARED=1\"");
+ REQUIRE(arg_list_to_string(sibsConfig.getCmakeArgsDynamic()) == "\"-G\" \"Ninja\" \"-DCMAKE_BUILD_TYPE=Debug\" \"-DENTITYX_RUN_BENCHMARKS=0\" \"-DENTITYX_BUILD_TESTING=0\" \"-DENTITYX_BUILD_SHARED=1\"");
}
TEST_CASE("parse config - invalid object")