Changed to use Catch2 v3

This commit is contained in:
yhirose 2021-08-17 19:13:31 -04:00
parent 13c490cd64
commit f5af8e44dc
7 changed files with 16 additions and 13059 deletions

View File

@ -19,8 +19,8 @@ endif()
add_subdirectory(example) add_subdirectory(example)
add_subdirectory(lint) add_subdirectory(lint)
add_subdirectory(test) add_subdirectory(test)
enable_testing() enable_testing()
install(FILES peglib.h DESTINATION include) install(FILES peglib.h DESTINATION include)

View File

@ -1,12 +1,21 @@
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
project(test) project(test)
include_directories(..) Include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.0.0-preview3
)
FetchContent_MakeAvailable(Catch2)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
add_executable(test-main test-main.cc test1.cc test2.cc test3.cc) add_executable(test-main test1.cc test2.cc test3.cc)
target_link_libraries(test-main ${add_link_deps})
target_include_directories(test-main PRIVATE ..)
target_link_libraries(test-main PRIVATE Catch2::Catch2WithMain)
add_test( add_test(
NAME TestMain NAME TestMain

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
#define CATCH_CONFIG_MAIN
#include "catch.hh"

View File

@ -1,4 +1,4 @@
#include "catch.hh" #include <catch2/catch_test_macros.hpp>
#include <peglib.h> #include <peglib.h>
using namespace peg; using namespace peg;

View File

@ -1,4 +1,4 @@
#include "catch.hh" #include <catch2/catch_test_macros.hpp>
#include <peglib.h> #include <peglib.h>
#include <sstream> #include <sstream>

View File

@ -1,4 +1,4 @@
#include "catch.hh" #include <catch2/catch_test_macros.hpp>
#include <peglib.h> #include <peglib.h>
using namespace peg; using namespace peg;