From cf83d1f8f4433f1e628b658acea63aa0b35e482d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Wed, 3 Apr 2024 20:51:21 +0200 Subject: [PATCH] Add tests for libraries required versions --- lib/folding | 2 +- lib/json | 2 +- tests/CMakeLists.txt | 4 +++- tests/TestPlatform.cpp | 19 ++++++++++++++++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/lib/folding b/lib/folding index 37316a5..71d6055 160000 --- a/lib/folding +++ b/lib/folding @@ -1 +1 @@ -Subproject commit 37316a54e0d558555ae02ae95c8bb083ec063874 +Subproject commit 71d6055be4488cf2e6443123ae8fc4a63ae289dc diff --git a/lib/json b/lib/json index 0457de2..199dea1 160000 --- a/lib/json +++ b/lib/json @@ -1 +1 @@ -Subproject commit 0457de21cffb298c22b629e538036bfeb96130b7 +Subproject commit 199dea11b17c533721b26249e2dcaee6ca1d51d3 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e3254f1..01b6d5f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,11 +5,13 @@ if(ENABLE_TESTING) ${Platform_SOURCE_DIR}/lib/argparse/include ${Platform_SOURCE_DIR}/lib/mdlp ${Platform_SOURCE_DIR}/lib/Files + ${Platform_SOURCE_DIR}/lib/json/include + ${Platform_SOURCE_DIR}/lib/folding ${CMAKE_BINARY_DIR}/configured_files/include /usr/local/include ) set(TEST_SOURCES_PLATFORM TestUtils.cpp TestPlatform.cpp) add_executable(${TEST_PLATFORM} ${TEST_SOURCES_PLATFORM}) - target_link_libraries(${TEST_PLATFORM} PUBLIC "${TORCH_LIBRARIES}" ArffFiles mdlp Catch2::Catch2WithMain) + target_link_libraries(${TEST_PLATFORM} PUBLIC "${TORCH_LIBRARIES}" ArffFiles mdlp Catch2::Catch2WithMain BayesNet) add_test(NAME ${TEST_PLATFORM} COMMAND ${TEST_PLATFORM}) endif(ENABLE_TESTING) diff --git a/tests/TestPlatform.cpp b/tests/TestPlatform.cpp index ea906aa..7e926c4 100644 --- a/tests/TestPlatform.cpp +++ b/tests/TestPlatform.cpp @@ -6,11 +6,28 @@ #include #include #include "TestUtils.h" +#include "folding.hpp" +#include #include "config.h" -TEST_CASE("Test Python Classifiers score", "[PyClassifiers]") +TEST_CASE("Test Platform version", "[Platform]") { std::string version = { platform_project_version.begin(), platform_project_version.end() }; REQUIRE(version == "1.0.4"); +} +TEST_CASE("Test Folding library version", "[Folding]") +{ + auto kfold = folding::KFold(5, 100); + REQUIRE(kfold.version() == "1.0.1"); +} +TEST_CASE("Test BayesNet version", "[BayesNet]") +{ + std::string version = bayesnet::TAN().getVersion(); + REQUIRE(version == "1.0.4"); +} +TEST_CASE("Test mdlp version", "[mdlp]") +{ + std::string version = mdlp::CPPFImdlp::version(); + REQUIRE(version == "1.1.2"); } \ No newline at end of file