make catch2 a submodule

pull/1103/head
Jeff Becker 4 years ago
parent e098c9628f
commit 827ca0bda7
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

3
.gitmodules vendored

@ -13,3 +13,6 @@
[submodule "external/ghc-filesystem"]
path = external/ghc-filesystem
url = https://github.com/gulrak/filesystem.git
[submodule "test/Catch2"]
path = test/Catch2
url = https://github.com/catchorg/Catch2

@ -77,12 +77,14 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_directories(${TEST_EXE} PRIVATE /usr/local/lib)
endif()
add_subdirectory(Catch2)
add_executable(${CHECK_EXE}
nodedb/test_nodedb.cpp
path/test_path.cpp
check_main.cpp)
target_link_libraries(${CHECK_EXE} PUBLIC ${STATIC_LIB})
target_link_libraries(${CHECK_EXE} PUBLIC ${STATIC_LIB} Catch2::Catch2)
target_include_directories(${CHECK_EXE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(check COMMAND ${CHECK_EXE})

@ -0,0 +1 @@
Subproject commit 81d52c4a5ffc1e527ce158c7570aa94dadc8c002

File diff suppressed because it is too large Load Diff

@ -1,2 +1,2 @@
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include <catch2/catch.hpp>

@ -1,4 +1,4 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include "config/config.hpp"
#include <router_contact.hpp>
@ -6,11 +6,10 @@
TEST_CASE("FindClosestTo returns correct number of elements", "[nodedb][dht]")
{
llarp_nodedb nodeDB(nullptr, "");
constexpr uint64_t numRCs = 3;
for (uint64_t i=0; i<numRCs; ++i)
for(uint64_t i = 0; i < numRCs; ++i)
{
llarp::RouterContact rc;
rc.pubkey[0] = i;
@ -29,7 +28,6 @@ TEST_CASE("FindClosestTo returns correct number of elements", "[nodedb][dht]")
TEST_CASE("FindClosestTo returns properly ordered set", "[nodedb][dht]")
{
llarp_nodedb nodeDB(nullptr, "");
// insert some RCs: a < b < c
@ -65,4 +63,3 @@ TEST_CASE("FindClosestTo returns properly ordered set", "[nodedb][dht]")
REQUIRE(c.pubkey == results[0].pubkey);
REQUIRE(b.pubkey == results[1].pubkey);
}

@ -1,5 +1,5 @@
#include <path/path.hpp>
#include "catch.hpp"
#include <catch2/catch.hpp>
using Path_t = llarp::path::Path;
using Path_ptr = llarp::path::Path_ptr;

Loading…
Cancel
Save