Merge pull request #1103 from majestrate/catch2-submodule-2020-02-17

make catch2 a submodule
pull/1104/head
Jeff 5 years ago committed by GitHub
commit f8c2ef340f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

3
.gitmodules vendored

@ -13,3 +13,6 @@
[submodule "external/ghc-filesystem"] [submodule "external/ghc-filesystem"]
path = external/ghc-filesystem path = external/ghc-filesystem
url = https://github.com/gulrak/filesystem.git 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) target_link_directories(${TEST_EXE} PRIVATE /usr/local/lib)
endif() endif()
add_subdirectory(Catch2)
add_executable(${CHECK_EXE} add_executable(${CHECK_EXE}
nodedb/test_nodedb.cpp nodedb/test_nodedb.cpp
path/test_path.cpp path/test_path.cpp
check_main.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}) target_include_directories(${CHECK_EXE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(check COMMAND ${CHECK_EXE}) 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 #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 "config/config.hpp"
#include <router_contact.hpp> #include <router_contact.hpp>
@ -6,11 +6,10 @@
TEST_CASE("FindClosestTo returns correct number of elements", "[nodedb][dht]") TEST_CASE("FindClosestTo returns correct number of elements", "[nodedb][dht]")
{ {
llarp_nodedb nodeDB(nullptr, ""); llarp_nodedb nodeDB(nullptr, "");
constexpr uint64_t numRCs = 3; constexpr uint64_t numRCs = 3;
for (uint64_t i=0; i<numRCs; ++i) for(uint64_t i = 0; i < numRCs; ++i)
{ {
llarp::RouterContact rc; llarp::RouterContact rc;
rc.pubkey[0] = i; 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]") TEST_CASE("FindClosestTo returns properly ordered set", "[nodedb][dht]")
{ {
llarp_nodedb nodeDB(nullptr, ""); llarp_nodedb nodeDB(nullptr, "");
// insert some RCs: a < b < c // 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(c.pubkey == results[0].pubkey);
REQUIRE(b.pubkey == results[1].pubkey); REQUIRE(b.pubkey == results[1].pubkey);
} }

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

Loading…
Cancel
Save