diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a0f2e5f9..bb038022 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -13,6 +13,8 @@ if(GMOCK_FOUND) add_executable(${TEST_NAME} ${TEST_FILE}.cpp) target_link_libraries(${TEST_NAME} cucumber-cpp-nomain ${CUKE_EXTRA_LIBRARIES} ${ARGN} ${CUKE_GMOCK_LIBRARIES}) gtest_add_tests(${TEST_NAME} "" ${TEST_FILE}.cpp) + # Run all tests in executable at once too. This ensures that the used fixtures get tested properly too. + add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME}) endfunction() # TODO Compile tests with the least possible code, not with the entire library diff --git a/tests/utils/HookRegistrationFixture.hpp b/tests/utils/HookRegistrationFixture.hpp index 7b090244..0e0e5424 100644 --- a/tests/utils/HookRegistrationFixture.hpp +++ b/tests/utils/HookRegistrationFixture.hpp @@ -118,12 +118,8 @@ class HookRegistrationTest : public CukeCommandsFixture { void SetUp() { CukeCommandsFixture::SetUp(); - addStepToManager(STATIC_MATCHER); - } - - void TearDown() { clearHookCallMarkers(); - CukeCommandsFixture::TearDown(); + addStepToManager(STATIC_MATCHER); } };