diff options
Diffstat (limited to 'tests/src/confTest')
-rw-r--r-- | tests/src/confTest/confTest.cpp | 43 | ||||
-rw-r--r-- | tests/src/confTest/gitDependency.conf | 9 | ||||
-rw-r--r-- | tests/src/confTest/validProject.conf | 1 |
3 files changed, 25 insertions, 28 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); - } -} diff --git a/tests/src/confTest/gitDependency.conf b/tests/src/confTest/gitDependency.conf deleted file mode 100644 index d18b267..0000000 --- a/tests/src/confTest/gitDependency.conf +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "confTest" -version = "0.1.0" -type = "library" -platforms = ["linux64", "win64"] - -[dependencies] -xxhash = { git = "https://github.com/DEC05EBA/xxHash.git", branch = "master" } -catch2 = "1.0.0" diff --git a/tests/src/confTest/validProject.conf b/tests/src/confTest/validProject.conf index cd3f9cc..c5232c6 100644 --- a/tests/src/confTest/validProject.conf +++ b/tests/src/confTest/validProject.conf @@ -7,6 +7,7 @@ platforms = ["linux64", "win64"] [dependencies] xxhash = "0.1.0" # random comment at end of line catch2 = "1.0.0" +sfml-all = { git = "https://github.com/DEC05EBA/sfml-all.git", branch = "master" } # cmake building is currrently not implemented, but it is intended to work like this [cmake] |