mirror of
https://gitlab.com/manzerbredes/chess-move-interface.git
synced 2025-05-21 06:47:42 +00:00
Add tests and improve interface
This commit is contained in:
parent
8fd85102ab
commit
f3e3ab4911
8 changed files with 21718 additions and 18 deletions
11
tests/CMakeLists.txt
Normal file
11
tests/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
|
||||
# Configure catch3
|
||||
include_directories(./catch3/)
|
||||
add_library(cmi_catch3 SHARED ./catch3/catch_amalgamated.cpp)
|
||||
|
||||
# Add tests
|
||||
add_executable(cmi_tests cmi_tests.cpp)
|
||||
target_link_libraries(cmi_tests ChessMoveInterface cmi_catch3)
|
||||
add_test(CMI_TESTS cmi_tests)
|
||||
|
||||
|
9929
tests/catch3/catch_amalgamated.cpp
Normal file
9929
tests/catch3/catch_amalgamated.cpp
Normal file
File diff suppressed because it is too large
Load diff
11652
tests/catch3/catch_amalgamated.hpp
Normal file
11652
tests/catch3/catch_amalgamated.hpp
Normal file
File diff suppressed because it is too large
Load diff
23
tests/cmi_tests.cpp
Normal file
23
tests/cmi_tests.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#include "CMI.hpp"
|
||||
#include <catch_amalgamated.hpp>
|
||||
|
||||
using namespace CMI;
|
||||
|
||||
#define NEW_MOVE(VAR,SAN) HalfMove *(VAR)=new HalfMove(); (VAR)->SetSAN((SAN));
|
||||
|
||||
|
||||
HalfMove *BuildTree(){
|
||||
NEW_MOVE(m1,"e4");
|
||||
NEW_MOVE(m2,"e5");
|
||||
m1->SetMainline(m2);
|
||||
return m1;
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("CMI Tests", "[valid]") {
|
||||
HalfMove *m=BuildTree();
|
||||
|
||||
CHECK(m->GetNumber()==1);
|
||||
CHECK(m->GetMainline()->GetNumber()==1);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue