From 7a18f875a8fa813e07c47f1167de87c0a66d798c Mon Sep 17 00:00:00 2001 From: Ben Vining Date: Mon, 9 Mar 2026 02:15:00 -0500 Subject: [PATCH] test: initial commit of matetrack test --- tests/CMakeLists.txt | 1 + tests/matetrack/CMakeLists.txt | 43 ++++++++++++++++++++++++++++++++++ tests/matetrack/README.md | 12 ++++++++++ 3 files changed, 56 insertions(+) create mode 100644 tests/matetrack/CMakeLists.txt create mode 100644 tests/matetrack/README.md diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4fc927b4..d6dd87b8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,6 +39,7 @@ endfunction () configure_file (CTestCustom.cmake "${BenBot_BINARY_DIR}/CTestCustom.cmake" @ONLY) add_subdirectory (fastchess) +add_subdirectory (matetrack) add_subdirectory (perft) add_subdirectory (position-solver) add_subdirectory (rampart) diff --git a/tests/matetrack/CMakeLists.txt b/tests/matetrack/CMakeLists.txt new file mode 100644 index 00000000..e6cfe08e --- /dev/null +++ b/tests/matetrack/CMakeLists.txt @@ -0,0 +1,43 @@ +# ====================================================================================== +# +# ░▒▓███████▓▒░░▒▓████████▓▒░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░▒▓████████▓▒░ +# ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ +# ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ +# ░▒▓███████▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ +# ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ +# ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ +# ░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓█▓▒░ +# +# ====================================================================================== + +check_python_modules_available (deps_available chess tqdm) + +add_feature_info (benbot_matetrack_testing deps_available "BenBot matetrack testing") + +if (NOT deps_available) + return () +endif () + +FetchContent_Declare ( + matetrack + SYSTEM + GIT_REPOSITORY "https://github.com/vondele/matetrack.git" + GIT_TAG origin/master + OVERRIDE_FIND_PACKAGE +) + +FetchContent_MakeAvailable (matetrack) + +add_test ( + NAME ben_bot.matetrack + COMMAND Python::Interpreter matecheck.py --engine "$" --epdFile + mates2000.epd --nodes 10000 --depth 10 --time 30 --showAllIssues --showAllStats --bench + WORKING_DIRECTORY "${matetrack_SOURCE_DIR}" + CONFIGURATIONS Release +) + +set_property ( + TEST ben_bot.matetrack APPEND + PROPERTY FAIL_REGULAR_EXPRESSION "the following issues were detected:" + "Exception parsing pv from info:" +) diff --git a/tests/matetrack/README.md b/tests/matetrack/README.md new file mode 100644 index 00000000..e50af4f0 --- /dev/null +++ b/tests/matetrack/README.md @@ -0,0 +1,12 @@ +# matetrack tests + +This directory implements test cases using the [matetrack](https://github.com/vondele/matetrack) tool to check the engine's mate-finding efficiency. + +## Dependencies + +### Programs +* Python interpreter + +### Python libraries +* [python-chess](https://python-chess.readthedocs.io/en/latest/index.html), needed by matetrack script +* [tqdm](https://pypi.org/project/tqdm/), needed by matetrack script