From f5d9fe6211bd397deb0ac19b634f551edfa0f6b8 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sun, 30 Jan 2022 20:19:02 +0100 Subject: Initialize project --- tests/CMakeLists.txt | 13 + tests/berserk.cpp | 86 + tests/berserk.sh | 8 + tests/catch3/catch_amalgamated.cpp | 9929 +++++++++++++++++++++++++++++ tests/catch3/catch_amalgamated.hpp | 11652 +++++++++++++++++++++++++++++++++++ tests/stockfish.cpp | 145 + tests/stockfish.sh | 7 + 7 files changed, 21840 insertions(+) create mode 100644 tests/CMakeLists.txt create mode 100644 tests/berserk.cpp create mode 100755 tests/berserk.sh create mode 100644 tests/catch3/catch_amalgamated.cpp create mode 100644 tests/catch3/catch_amalgamated.hpp create mode 100644 tests/stockfish.cpp create mode 100755 tests/stockfish.sh (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..2ace20f --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,13 @@ + +# Configure catch3 +include_directories(./catch3/) +add_library(catch3 SHARED ./catch3/catch_amalgamated.cpp) + +# Add tests +add_executable(stockfish stockfish.cpp) +target_link_libraries(stockfish uciadapter catch3) +add_test(Stockfish stockfish) + +add_executable(berserk berserk.cpp) +target_link_libraries(berserk uciadapter catch3) +add_test(Berserk berserk) \ No newline at end of file diff --git a/tests/berserk.cpp b/tests/berserk.cpp new file mode 100644 index 0000000..2082f74 --- /dev/null +++ b/tests/berserk.cpp @@ -0,0 +1,86 @@ +#include "UCI.hpp" +#include + +#define LATENCY 4000 + +using namespace uciadapter; + +TEST_CASE("Berserk Initialisation", "[berserk/init]") { + REQUIRE_NOTHROW([&]() { UCI("./berserk_engine"); }()); + + UCI u("./berserk_engine"); + REQUIRE(u.GetName() == "Berserk 8.5.1 NN (6fb1a076a856)"); + REQUIRE(u.GetAuthor() == "Jay Honnold"); + + std::vector