From e870a1700157ea2ed6b843815dd5d436bdb44cfc Mon Sep 17 00:00:00 2001 From: yamacir-kit Date: Sun, 2 Jun 2024 22:03:30 +0900 Subject: [PATCH] Cleanup `configurator` Signed-off-by: yamacir-kit --- CMakeLists.txt | 12 ++++ README.md | 6 +- VERSION | 2 +- include/meevax/kernel/configurator.hpp | 84 +++++++------------------- include/meevax/kernel/error.hpp | 4 +- src/kernel/error.cpp | 6 +- test/option.sh | 8 +++ 7 files changed, 50 insertions(+), 72 deletions(-) create mode 100755 test/option.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 31eaf18d6..3e92ccc68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,6 +209,18 @@ foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_CPP) ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_${FILENAME}) endforeach() +file(GLOB ${PROJECT_NAME}_TEST_SH ${CMAKE_CURRENT_SOURCE_DIR}/test/*.sh) + +foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_SH) + get_filename_component(FILENAME ${EACH} NAME_WE) + add_test( + NAME ${FILENAME} + COMMAND ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND} + ${${PROJECT_NAME}_MEMORY_CHECK_OPTIONS} + ${EACH} + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/meevax) +endforeach() + # ---- Additional Targets ------------------------------------------------------ execute_process(COMMAND nproc OUTPUT_VARIABLE ${PROJECT_NAME}_NPROC) diff --git a/README.md b/README.md index f13fbd235..23e4fc726 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Procedures for each standard are provided by the following R7RS-style libraries: cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.5.190_amd64.deb +sudo apt install build/meevax_0.5.191_amd64.deb ``` or @@ -122,9 +122,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.190.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.191.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.190_amd64.deb` +| `package` | Generate debian package `meevax_0.5.191_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index a81dc9010..d1f514113 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.190 +0.5.191 diff --git a/include/meevax/kernel/configurator.hpp b/include/meevax/kernel/configurator.hpp index 6ad24186f..252456a71 100644 --- a/include/meevax/kernel/configurator.hpp +++ b/include/meevax/kernel/configurator.hpp @@ -35,12 +35,12 @@ inline namespace kernel { std::regex const pattern; - std::function const&)> build; + std::function object> const&) -> void> evaluate; template explicit option(S&& s, F&& f) - : pattern { std::forward(s) } - , build { std::forward(f) } + : pattern { std::forward(s) } + , evaluate { std::forward(f) } {} }; @@ -60,71 +60,44 @@ inline namespace kernel auto configure(std::vector const& args) -> void { - static auto const pattern = std::regex(R"(--(\w[-\w]+)(=(.*))?|-([\w]+))"); + auto const static pattern = std::regex(R"(--(\w[-\w]+)(=(.*))?|-([\w]+))"); - auto const options = std::vector