diff --git a/CHANGELOG.md b/CHANGELOG.md index 03827ac..016627c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - A2DE model. - A2DE & SPnDE tests. - Add tests to reach 99% of coverage. +- Add tests to check the correct version of the mdlp, folding and json libraries. ### Internal diff --git a/lib/folding b/lib/folding index 71d6055..2ac43e3 160000 --- a/lib/folding +++ b/lib/folding @@ -1 +1 @@ -Subproject commit 71d6055be4488cf2e6443123ae8fc4a63ae289dc +Subproject commit 2ac43e32ac1eac0c986702ec526cf5367a565ef0 diff --git a/lib/mdlp b/lib/mdlp index 5708dc3..236d1b2 160000 --- a/lib/mdlp +++ b/lib/mdlp @@ -1 +1 @@ -Subproject commit 5708dc3de944fc22d61a2dd071b63aa338e04db3 +Subproject commit 236d1b2f8be185039493fe7fce04a83e02ed72e5 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e54cc18..a878442 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,8 +9,8 @@ if(ENABLE_TESTING) ) file(GLOB_RECURSE BayesNet_SOURCES "${BayesNet_SOURCE_DIR}/bayesnet/*.cc") add_executable(TestBayesNet TestBayesNetwork.cc TestBayesNode.cc TestBayesClassifier.cc - TestBayesModels.cc TestBayesMetrics.cc TestFeatureSelection.cc TestBoostAODE.cc TestA2DE.cc - TestUtils.cc TestBayesEnsemble.cc ${BayesNet_SOURCES}) + TestBayesModels.cc TestBayesMetrics.cc TestFeatureSelection.cc TestBoostAODE.cc TestA2DE.cc + TestUtils.cc TestBayesEnsemble.cc TestModulesVersions.cc ${BayesNet_SOURCES}) target_link_libraries(TestBayesNet PUBLIC "${TORCH_LIBRARIES}" ArffFiles mdlp PRIVATE Catch2::Catch2WithMain) add_test(NAME BayesNetworkTest COMMAND TestBayesNet) add_test(NAME Network COMMAND TestBayesNet "[Network]") @@ -22,4 +22,5 @@ if(ENABLE_TESTING) add_test(NAME Models COMMAND TestBayesNet "[Models]") add_test(NAME BoostAODE COMMAND TestBayesNet "[BoostAODE]") add_test(NAME A2DE COMMAND TestBayesNet "[A2DE]") + add_test(NAME Modules COMMAND TestBayesNet "[Modules]") endif(ENABLE_TESTING) diff --git a/tests/TestModulesVersions.cc b/tests/TestModulesVersions.cc new file mode 100644 index 0000000..c9a44e0 --- /dev/null +++ b/tests/TestModulesVersions.cc @@ -0,0 +1,37 @@ +// *************************************************************** +// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez +// SPDX-FileType: SOURCE +// SPDX-License-Identifier: MIT +// *************************************************************** + +#include +#include +#include +#include +#include +#include +#define TO_STR2(x) #x +#define TO_STR(x) TO_STR2(x) +#define JSON_VERSION (TO_STR(NLOHMANN_JSON_VERSION_MAJOR) "." TO_STR(NLOHMANN_JSON_VERSION_MINOR)) +#include "TestUtils.h" + +std::map modules = { + { "mdlp", "1.1.2" }, + { "Folding", "1.1.0" }, + { "json", "3.11" } +}; + +TEST_CASE("MDLP", "[Modules]") +{ + auto fimdlp = mdlp::CPPFImdlp(); + REQUIRE(fimdlp.version() == modules["mdlp"]); +} +TEST_CASE("Folding", "[Modules]") +{ + auto folding = folding::KFold(5, 200); + REQUIRE(folding.version() == modules["Folding"]); +} +TEST_CASE("NLOHMANN_JSON", "[Modules]") +{ + REQUIRE(JSON_VERSION == modules["json"]); +} diff --git a/tests/lib/catch2 b/tests/lib/catch2 new file mode 160000 index 0000000..4e8d92b --- /dev/null +++ b/tests/lib/catch2 @@ -0,0 +1 @@ +Subproject commit 4e8d92bf02f7d1c8006a0e7a5ecabd8e62d98502