Add tests to check the correct version of the mdlp, folding and json libraries
This commit is contained in:
@@ -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
|
||||
|
||||
|
Submodule lib/folding updated: 71d6055be4...2ac43e32ac
2
lib/mdlp
2
lib/mdlp
Submodule lib/mdlp updated: 5708dc3de9...236d1b2f8b
@@ -10,7 +10,7 @@ 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})
|
||||
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)
|
||||
|
37
tests/TestModulesVersions.cc
Normal file
37
tests/TestModulesVersions.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
// ***************************************************************
|
||||
// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez
|
||||
// SPDX-FileType: SOURCE
|
||||
// SPDX-License-Identifier: MIT
|
||||
// ***************************************************************
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/matchers/catch_matchers.hpp>
|
||||
#include <string>
|
||||
#include <CPPFImdlp.h>
|
||||
#include <folding.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
#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<std::string, std::string> 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"]);
|
||||
}
|
1
tests/lib/catch2
Submodule
1
tests/lib/catch2
Submodule
Submodule tests/lib/catch2 added at 4e8d92bf02
Reference in New Issue
Block a user