Skip to content

Commit

Permalink
feat: add InterfaceMock.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
DNKpp committed Sep 24, 2024
1 parent 1962d47 commit 848060b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ target_include_directories(
"include"
)

target_compile_options(
mimicpp
INTERFACE
# this option is required to make __VA_OPT__ work on msvc
"$<$<CXX_COMPILER_ID:MSVC>:/Zc:preprocessor>"
)

set(CMAKE_CXX_STANDARD 20)
if (MIMICPP_FORCED_CXX_STANDARD)
set(CMAKE_CXX_STANDARD ${MIMICPP_FORCED_CXX_STANDARD})
Expand Down
23 changes: 23 additions & 0 deletions include/mimic++/InterfaceMock.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// // Copyright Dominic (DNKpp) Koepke 2024 - 2024.
// // Distributed under the Boost Software License, Version 1.0.
// // (See accompanying file LICENSE_1_0.txt or copy at
// // https://www.boost.org/LICENSE_1_0.txt)

#ifndef MIMICPP_INTERFACE_MOCK_HPP
#define MIMICPP_INTERFACE_MOCK_HPP

#pragma once

#include "mimic++/Fwd.hpp"
#include "mimic++/Mock.hpp"

#endif

namespace mimicpp
{
/**
* \defgroup INTERFACES interfaces
* \ingroup MOCK
* \brief Contains utility to simplify interface mocking.
*/
}
1 change: 1 addition & 0 deletions test/unit-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ add_executable(
"Expectation.cpp"
"ExpectationBuilder.cpp"
"ExpectationPolicies.cpp"
"InterfaceMock.cpp"
"Matcher.cpp"
"Mock.cpp"
"Printer.cpp"
Expand Down
19 changes: 19 additions & 0 deletions test/unit-tests/InterfaceMock.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright Dominic (DNKpp) Koepke 2024 - 2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)

#include "TestReporter.hpp"
#include "TestTypes.hpp"

#include "mimic++/InterfaceMock.hpp"

#include <catch2/catch_template_test_macros.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <catch2/generators/catch_generators_range.hpp>
#include <catch2/matchers/catch_matchers_container_properties.hpp>
#include <catch2/matchers/catch_matchers_string.hpp>
#include <catch2/matchers/catch_matchers_templated.hpp>


0 comments on commit 848060b

Please sign in to comment.