diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 3f4425e..076ecf2 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,7 +1,9 @@ find_package(fmt REQUIRED) +add_compile_definitions(DATA_STORAGE_PATH="${CMAKE_SOURCE_DIR}/data") + add_executable(main main.cpp) target_link_libraries(main PRIVATE cecxx fmt::fmt) set_target_properties(main PROPERTIES CXX_STANDARD 20) -target_compile_options(main PRIVATE -Wall -Wextra -Wpedantic -O3) +target_compile_options(main PRIVATE -Wall -Wextra -Wpedantic -Werror -O3) diff --git a/example/main.cpp b/example/main.cpp index 67f8161..5aa637c 100644 --- a/example/main.cpp +++ b/example/main.cpp @@ -10,8 +10,6 @@ #include "cecxx/benchmark/evaluator.hpp" -constexpr auto CEC_STORAGE{"/home/ewarchul/open-source/optim/cecxx/data"}; - namespace rv = ranges::views; using namespace cecxx; @@ -20,8 +18,9 @@ auto main() -> int { const auto dimensions = std::vector{10ul, 30ul, 50ul, 100ul}; // Create an evaluator object for the CEC2017 benchmark - auto cec2017_eval = benchmark::evaluator( - cecxx::benchmark::cec_edition_t::cec2017, dimensions, CEC_STORAGE); + auto cec2017_eval = + benchmark::evaluator(cecxx::benchmark::cec_edition_t::cec2017, + dimensions, DATA_STORAGE_PATH); // create problem grid [problem_number X dimension] const auto problem_grid = diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index eb8285e..e0932d1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,7 +13,7 @@ fuzztest_setup_fuzzing_flags() add_compile_definitions(DATA_STORAGE_PATH="${CMAKE_SOURCE_DIR}/data") -add_executable(cecxx-fuzz gtest/cec2017_oracle_test.cpp oracle/cec2017.cpp) +add_executable(cecxx-fuzz gtest/cec2017_oracle_compliance_test.cpp oracle/cec2017.cpp) target_include_directories(cecxx-fuzz PUBLIC .) target_link_libraries(cecxx-fuzz PRIVATE cecxx) diff --git a/test/gtest/cec2017_oracle_test.cpp b/test/gtest/cec2017_oracle_compliance_test.cpp similarity index 90% rename from test/gtest/cec2017_oracle_test.cpp rename to test/gtest/cec2017_oracle_compliance_test.cpp index 6b38f99..59dbcb6 100644 --- a/test/gtest/cec2017_oracle_test.cpp +++ b/test/gtest/cec2017_oracle_compliance_test.cpp @@ -22,7 +22,7 @@ constexpr auto MAX_ABS_ERROR = 1e-8; constexpr auto CEC_2017_LOWER_BOUND = -100.0; constexpr auto CEC_2017_UPPER_BOUND = 100.0; -class Cec2017ConformanceTest +class Cec2017ComplianceTest : public PerFuzzTestFixtureAdapter< CecTestFixture> { public: @@ -51,25 +51,25 @@ class Cec2017ConformanceTest } }; -FUZZ_TEST_F(Cec2017ConformanceTest, Cec2017D10ImplsAreEquiv) +FUZZ_TEST_F(Cec2017ComplianceTest, Cec2017D10ImplsAreEquiv) .WithDomains(PositiveVectorOf(InRange(CEC_2017_LOWER_BOUND, CEC_2017_UPPER_BOUND)) .WithSize(10), InCecProblemRange(cec_edition_t::cec2017)); -FUZZ_TEST_F(Cec2017ConformanceTest, Cec2017D30ImplsAreEquiv) +FUZZ_TEST_F(Cec2017ComplianceTest, Cec2017D30ImplsAreEquiv) .WithDomains(PositiveVectorOf(InRange(CEC_2017_LOWER_BOUND, CEC_2017_UPPER_BOUND)) .WithSize(30), InCecProblemRange(cec_edition_t::cec2017)); -FUZZ_TEST_F(Cec2017ConformanceTest, Cec2017D50ImplsAreEquiv) +FUZZ_TEST_F(Cec2017ComplianceTest, Cec2017D50ImplsAreEquiv) .WithDomains(PositiveVectorOf(InRange(CEC_2017_LOWER_BOUND, CEC_2017_UPPER_BOUND)) .WithSize(50), InCecProblemRange(cec_edition_t::cec2017)); -FUZZ_TEST_F(Cec2017ConformanceTest, Cec2017D100ImplsAreEquiv) +FUZZ_TEST_F(Cec2017ComplianceTest, Cec2017D100ImplsAreEquiv) .WithDomains(PositiveVectorOf(InRange(CEC_2017_LOWER_BOUND, CEC_2017_UPPER_BOUND)) .WithSize(100),