diff --git a/Makefile b/Makefile index 29dd0f3..f107db6 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ build: ## Build a debug version of the project @if [ -d $(f_debug) ]; then rm -rf $(f_debug); fi @mkdir $(f_debug); conan install . -of $(f_debug) -s build_type=Debug -b missing - cmake -B $(f_debug) -S . -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=$(f_debug)/build/Debug/generators/conan_toolchain.cmake -DENABLE_TESTING=ON + cmake -B $(f_debug) -S . -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=$(f_debug)/conan_toolchain.cmake -DENABLE_TESTING=ON cmake --build $(f_debug) -t $(test_targets) $(n_procs) @echo ">>> Done"; diff --git a/conanfile.py b/conanfile.py index 90161b9..d096a62 100644 --- a/conanfile.py +++ b/conanfile.py @@ -43,7 +43,7 @@ class FoldingConan(ConanFile): # Test dependencies self.test_requires("catch2/3.8.1") self.test_requires("arff-files/1.2.1") - self.test_requires("fimdlp/2.1.0") + self.test_requires("fimdlp/2.1.1") def layout(self): # Only use cmake_layout for conan packaging, not for development builds diff --git a/folding.hpp b/folding.hpp index 91a381b..a6f6cc4 100644 --- a/folding.hpp +++ b/folding.hpp @@ -10,8 +10,8 @@ #include #include #include +#include namespace folding { - const std::string FOLDING_VERSION = "1.1.1"; class Fold { public: inline Fold(int k, int n, int seed = -1) : k(k), n(n), seed(seed) diff --git a/tests/TestFolding.cc b/tests/TestFolding.cc index 6ab8159..bbc2469 100644 --- a/tests/TestFolding.cc +++ b/tests/TestFolding.cc @@ -9,10 +9,11 @@ #include #include "TestUtils.h" #include "folding.hpp" +#include TEST_CASE("Version Test", "[Folding]") { - std::string actual_version = "1.1.1"; + std::string actual_version = FOLDING_VERSION; auto data = std::vector(100); folding::StratifiedKFold stratified_kfold(5, data, 17); REQUIRE(stratified_kfold.version() == actual_version); diff --git a/tests/TestUtils.h b/tests/TestUtils.h index 693c695..5b2600c 100644 --- a/tests/TestUtils.h +++ b/tests/TestUtils.h @@ -8,6 +8,7 @@ #include #include "ArffFiles.hpp" #include "fimdlp/CPPFImdlp.h" +#include "folding_config.h" bool file_exists(const std::string& name); std::pair, map> discretize(std::vector& X, mdlp::labels_t& y, std::vector features); @@ -44,11 +45,12 @@ class Paths { public: static std::string datasets() { - return "data/"; + std::string result = { folding_data_path.begin(), folding_data_path.end() }; + return result + "/"; } static std::string csv() { - return "../../tests/csv/"; + return datasets() + "../csv/"; } }; class CSVFiles { @@ -73,4 +75,4 @@ public: return indices; } }; -#endif //TEST_UTILS_H \ No newline at end of file +#endif //TEST_UTILS_H