diff options
Diffstat (limited to 'tests/src/confTest/confTest.cpp')
-rw-r--r-- | tests/src/confTest/confTest.cpp | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/tests/src/confTest/confTest.cpp b/tests/src/confTest/confTest.cpp index d24c460..5b0fd0f 100644 --- a/tests/src/confTest/confTest.cpp +++ b/tests/src/confTest/confTest.cpp @@ -1,4 +1,4 @@ -#include "catch2/2.0.1/catch.hpp" +#include "catch.hpp" #include "../../../include/Conf.hpp" using namespace sibs; @@ -19,14 +19,30 @@ TEST_CASE("parse config") REQUIRE(containsPlatform(sibsConfig.getPlatforms(), PLATFORM_LINUX64)); REQUIRE(containsPlatform(sibsConfig.getPlatforms(), PLATFORM_WIN64)); - REQUIRE(sibsConfig.getDependencies().size() == 2); - const auto &xxhashDependency = sibsConfig.getDependencies()[0]; - REQUIRE(xxhashDependency.name == "xxhash"); - REQUIRE(xxhashDependency.version == "0.1.0"); + REQUIRE(sibsConfig.getPackageListDependencies().size() == 2); + for(auto *dep : sibsConfig.getPackageListDependencies()) + { + REQUIRE(dep->getSource() == Dependency::Source::PACKAGE_LIST); + } + auto *xxhashDependency = sibsConfig.getPackageListDependencies()[0]->asPackageListDependency(); + REQUIRE(xxhashDependency->name == "xxhash"); + REQUIRE(xxhashDependency->version == "0.1.0"); - const auto &catch2Dependency = sibsConfig.getDependencies()[1]; - REQUIRE(catch2Dependency.name == "catch2"); - REQUIRE(catch2Dependency.version == "1.0.0"); + const auto &catch2Dependency = sibsConfig.getPackageListDependencies()[1]->asPackageListDependency(); + REQUIRE(catch2Dependency->name == "catch2"); + REQUIRE(catch2Dependency->version == "1.0.0"); + + REQUIRE(sibsConfig.getGitDependencies().size() == 1); + for(auto *dep : sibsConfig.getGitDependencies()) + { + REQUIRE(dep->getSource() == Dependency::Source::GIT); + } + const Dependency *sfmlAllDependency = sibsConfig.getGitDependencies()[0]; + const GitDependency *sfmlAllDependencyGit = sfmlAllDependency->asGitDependency(); + REQUIRE(sfmlAllDependencyGit->name == "sfml-all"); + REQUIRE(sfmlAllDependencyGit->url == "https://github.com/DEC05EBA/sfml-all.git"); + REQUIRE(sfmlAllDependencyGit->branch == "master"); + REQUIRE(sfmlAllDependencyGit->revision == "HEAD"); REQUIRE(sibsConfig.shouldUseCmake()); @@ -104,14 +120,3 @@ TEST_CASE("parse config - define dynamic") REQUIRE(sibsConfig.getDefinedValue("BUILD_STATIC") == "0"); REQUIRE(sibsConfig.getDefinedValue("DEFINE_TYPE") == "DYNAMIC"); } - -TEST_CASE("parse config - git dependency") -{ - SibsConfig sibsConfig(Compiler::GCC, TINYDIR_STRING("tests/src/confTest"), OPT_LEV_DEBUG, false); - Result<bool> result = Config::readFromFile(TINYDIR_STRING("tests/src/confTest/gitDependency.conf"), sibsConfig); - if(result.isErr()) - { - fprintf(stderr, "%s", result.getErrMsg().c_str()); - exit(1); - } -} |