mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 04:12:13 +00:00
Updated googletest to release-1.12.1 and catch2 to v3.3.2
This commit is contained in:
parent
103ef4a00f
commit
ddf8581e48
@ -8,13 +8,16 @@ include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG release-1.8.1
|
||||
GIT_TAG release-1.12.1
|
||||
)
|
||||
|
||||
# Fetch GoogleTest amd make build scripts available
|
||||
if (NOT googletest_POPULATED)
|
||||
FetchContent_Populate(googletest)
|
||||
endif()
|
||||
FetchContent_Declare(
|
||||
catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v3.3.2
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(googletest catch2)
|
||||
|
||||
#set(gtest_force_shared_crt OFF CACHE BOOL "" FORCE)
|
||||
# Force Google Test to link the C/C++ runtimes dynamically when
|
||||
@ -25,9 +28,6 @@ if (MSVC)
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
# Bring the populated content into the build
|
||||
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
|
||||
|
||||
# uncomment this line to enable coverage measurements using gcov
|
||||
# set(CMAKE_CXX_FLAGS "--coverage")
|
||||
|
||||
|
||||
@ -2419,12 +2419,12 @@ verifyAllCombinations(Converter&& converter, const Containers&... inputs)
|
||||
|
||||
#ifdef APPROVALS_CATCH
|
||||
|
||||
#include <Catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
//namespace ApprovalTests {
|
||||
struct Catch2ApprovalListener : Catch::TestEventListenerBase {
|
||||
struct Catch2ApprovalListener : Catch::EventListenerBase {
|
||||
ApprovalTests::TestName currentTest;
|
||||
using TestEventListenerBase::TestEventListenerBase; // This using allows us to use all base-class constructors
|
||||
using EventListenerBase::EventListenerBase; // This using allows us to use all base-class constructors
|
||||
virtual void testCaseStarting(Catch::TestCaseInfo const &testInfo) override {
|
||||
|
||||
currentTest.setFileName(testInfo.lineInfo.file);
|
||||
@ -2452,8 +2452,8 @@ CATCH_REGISTER_LISTENER(Catch2ApprovalListener)
|
||||
#ifdef TEST_COMMIT_REVERT_CATCH
|
||||
|
||||
//namespace ApprovalTests {
|
||||
struct Catch2TestCommitRevert : Catch::TestEventListenerBase {
|
||||
using TestEventListenerBase::TestEventListenerBase; // This using allows us to use all base-class constructors
|
||||
struct Catch2TestCommitRevert : Catch::EventListenerBase {
|
||||
using EventListenerBase::EventListenerBase; // This using allows us to use all base-class constructors
|
||||
virtual void testRunEnded( Catch::TestRunStats const& testRunStats )override{
|
||||
bool commit = testRunStats.totals.testCases.allOk();
|
||||
std::string message = "r ";
|
||||
|
||||
17597
cpp/lib/Catch.hpp
17597
cpp/lib/Catch.hpp
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
set(TEST_NAME GildedRoseCatch2ApprovalTests)
|
||||
add_executable(${TEST_NAME})
|
||||
target_sources(${TEST_NAME} PRIVATE GildedRoseCatch2ApprovalTests.cc)
|
||||
target_link_libraries(${TEST_NAME} lib src)
|
||||
target_link_libraries(${TEST_NAME} lib src Catch2::Catch2 Catch2::Catch2WithMain)
|
||||
set_property(TARGET ${TEST_NAME} PROPERTY CXX_STANDARD 11)
|
||||
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
set(TEST_NAME GildedRoseCatch2UnitTests)
|
||||
add_executable(${TEST_NAME})
|
||||
target_sources(${TEST_NAME} PRIVATE GildedRoseCatch2UnitTests.cc)
|
||||
target_link_libraries(${TEST_NAME} lib src)
|
||||
target_link_libraries(${TEST_NAME} lib src Catch2::Catch2 Catch2::Catch2WithMain )
|
||||
set_property(TARGET ${TEST_NAME} PROPERTY CXX_STANDARD 11)
|
||||
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
|
||||
#include "Catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include "GildedRose.h"
|
||||
|
||||
TEST_CASE("GildedRoseUnitTest", "Foo")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user