Skip to content

Releases: rollbear/trompeloeil

v49

07 Oct 05:51
Compare
Choose a tag to compare

10 year anniversary release! 🎉

  • Added mocking macros that infers function arity from a trailing return
    type syntax signature.

    MAKE_MOCK(name, signature {, specifiers})
    MAKE_CONST_MOCK(name, signature {, specifiers})
    MAKE_STDMETHOD_MOCK(name, signature {, specifiers})
    

    Note that these only work with trailing return type syntax. Examples
    of specifiers are override, final and noexcept

    The preprocessor is limited and can only handle nullary functions,
    i.e. functions that do not accept any arguments, in some cases.

    MSVC handles nullary functions when compiling with /Zc:preprocessor
    with MSVC 19.40 (VS 17.10) or later.

    Gcc and Clang always handles nullary functions when compiling with
    C++20 or later, and when enabling a gcc extension by compiling with
    -std=gnu++11/14/17 and defining the macro TROMPELOEIL_HAS_GCC_PP before
    #include:ing the trompeloeil headers.

  • Added .RT_TIMES() to exceptations, which works like .TIMES()
    but where the limits are only known at runtime. Thank you
    @DNKpp for submitting the implementation.

  • Added several new composable matchers.

    • range matchers range_includes(*elements*), range_is(*elements*),
      range_is_permutation(*elements*), range_all_of(*comparator*),
      range_none_of(*comparator*), range_any_of(*comparator*),
      range_starts_with(*elements*) and range_ends_with(*elements*).

      Use in expectations as:

      REQUIRE_CALL(obj, vector_func(range_starts_with(2,3,5,8)));
      
    • MEMBER_IS(ptr_to_mem, matcher). Use as:

      REQUIRE_CALL(obj, func(MEMBER_IS(&type::height, gt(5)));
      
    • all_of(matchers), any_of(matchers), none_of(matchers). Use as:

      REQUIRE_CALL(obj, func(any_of(-1, gt(0))));
      

      These can be composed like:

      REQUIRE_CALL(obj, func(range_all_of(
                               any_of(MEMBER_IS(&type::x, -1),
                                      MEMBER_IS(&type::y, gt(0))))));
      

      Thank you @chghehe for the suggestion.

  • When an expectation is constrained by several .WITH() clauses, a
    violation report will only include the first failed condition,
    short cirquiting the logic.

    Example:

    REQUIRE_CALL(obj, func(_))
    .WITH(_1 != nullptr)
    .WITH(*_1 == 0); // would be runtime crash on nullptr access
    

    Thank you Örjan Gustavsson for the suggestion.

v48

14 Jul 08:38
Compare
Choose a tag to compare
v48
  • Fixed memory leak when adding an action (.RETURN, .SIDE_EFFECT, etc)
    throws. Thank you @DNKpp for the fix.

  • Dropped older compilers from CI builds (gcc <= 6 and clang <= 7) since
    GitHub actions now require node-20, and no build environment is
    currently available that both supports node-20 and older compilers.

  • Support for STDMETHOD functions for COM. Thank you @cesenaLA for
    the implementation, and @puetzk for the discussions. This adds new macros:

    MAKE_STDMETHOD_MOCKn(...)
    IMPLEMENT_STDMETHOD_MOCKn(...)

  • Fixed issue with std::expected causing compilation error. Thank you
    @subbota-a for reporting

  • Silenced gcc -Weffc++ warnings. Thanks @svenihoney for the report

v47

01 Jan 12:43
Compare
Choose a tag to compare
v47
  • Coroutines are conditionally supported by the __cpp_impl_coroutine
    feature test macro. There is no longer any need to define the
    TROMPELOEIL_EXPERIMENTAL_COROUTINES macro in order to use coroutines
    with Trompeloeil.

  • Split the monolithic "trompeloeil.hpp" into several smaller
    headers. You can continue to #include <trompeloeil.hpp> as usual,
    but you can also do more fine-grained #include, which may
    improve build times. E.g.:

    #include <trompeloeil/mock.hpp> // basic mock functionality
    #include <trompeloeil/lifetime.hpp> // REQUIRE_DESTRUCTION etc.
    #include <trompeloeil/matcher/re.hpp> // regular expressions
    

    The reference manual says which header to include to get the
    functionality for each item. If no header is mentioned, it is in
    <trompeloeil/mock.hpp>

v46

06 Nov 07:11
Compare
Choose a tag to compare
v46
  • Experimental support for coroutines. Use CO_RETURN (or LR_CO_RETURN)
    for a member function that has a coroutine return type. Use CO_THROW
    (or LR_CO_THROW) to throw from a coroutine. Use as many CO_YIELD
    (or LR_CO_YIELD) from a coroutine function as you like, as long as the
    promise type supports it.

    The experimental support must be explicitly enabled with

      #define TROMPELOEIL_EXPERIMENTAL_COROUTINES
      #include <trompeloeil.hpp>

    trompeloeil::stream_tracer does not produce correct result for coroutines

  • Corrected output of input-range like types. Thank you @DNKpp for
    the fix.

  • The self test program "custom_recursive_mutex" now says that it's
    succeeded. Thank you @yurivict for reporting the confusion.

  • Self test programs are only build when explicitly setting
    -DTROMPELOEIL_BUILD_TESTS=yes to the CMake command line.

  • The self test programs require a higher version of CMake (3.19 currently)

v45

21 Jul 14:34
Compare
Choose a tag to compare
v45
  • Support matching regular expressions to std::string view

  • Added adapter for QA Systems Cantata. Thank you Andreas Schätti

v44

10 Apr 05:43
Compare
Choose a tag to compare
v44
  • Fixed issue 293: Wildcard _ could not match types that can be constructed from any type. This fix unfortunately turns off conversion warnings for REQUIRE_CALL and friends when building with gcc. Thank you @TimonNoethlichs for reporting.

  • Fixed issue 296: Improved sequence violation message when ALLOW_CALL is involved. Thank you Sigurður Sveinn Halldórsson for reporting.

  • Fixed -Wunsafe-buffer-usage warning from clang-16

  • static_assert() when trying to get a runtime value from any matcher

  • Bumped required CMake version to 3.14 or later. Thank you Luke Dennis for reporting.

v43

26 Oct 10:19
Compare
Choose a tag to compare
v43
  • Added static_assert to duck_typed_matcher's templatized conversion function explaining why it should never be instantiated. Issue #270.

  • Added gcc-12 and clang++-15 to the CI build matrix

  • Fixed issue #272: Support Catch2 piecemeal headers.

  • Fix issue #279 where the doctest adapter showed violation messages as hex addresses for most recent releases of doctest. Thanks @SimonKagstrom for reporting.

  • Fixed an obscure bug where an expectation could match with a sequence object that has run to completion.

  • Specify ARCH_INDEPENDENT when creating package version file in CMake.

v42

07 Dec 11:48
Compare
Choose a tag to compare
v42
  • Fixed issue #264: Sequence objects did not correctly report
    is_complete() when there were living, but satisfied, expectations
    remaining. Thank you Václav Kubernát for reporting.

  • Fixed issue #259 where CMakeFiles.txt wrongly installed trompeloeil
    for projects that includes it. It is now an option. See FAQ for
    details. Thank you Ismail Pazarbasi for reporting and fixing.

  • Updated Catch2 to version 2.13.7 to compile unit tests on systems
    with glibc >= 2.34.

  • Fixed issue #255: Hex dumps showed byte values <= 15(dec) wrong.
    Thank you Stuart Dootson for reporting.

  • Fixed issue #253: Resolve lingering warnings in early Clang compilers
    and enable -Wzero-as-null-pointer-constant when compiling unit tests
    with GCC and Clang.

  • Fixed issue #250: Warnings about zero argument variadic macros with
    clang-msvc. Thank you u3shit for reporting and fixing.

  • Fixed issue #251: trompeloeil::printer<> customization point now
    supports SFINAE expressions to constrain partial specializations.
    Thank you Christian Morales Vega for reporting.

  • Fixed issue #245: Modify cmake to build thread_terror on Windows with
    MSVC.

  • Use CMake internal Threads::Threads target where needed. Thank you
    Martin Hořeňovský for reporting.

  • For CI builds, use github actions cacheing of built libc++ to shorten
    build times.

  • Added CMake install namespace. Thank you offa

  • Fixed bug where an expectation end of life was reported as an error
    if it was included in a satisfied sequence. Thank you Andy Saul.

v41

15 Jun 13:17
Compare
Choose a tag to compare
v41
  • catch2 adapter works with CATCH_CONFIG_PREFIX_ALL.
    thanks Christian Morales Vega

  • Silenced -Wreserved-identifier from Clang "latest" (13.0.0).

  • Silenced (again) the MSVC C4702 warning from the default_return<>()
    function template.

  • Introduced type trompeloeil::printer as a customization point or
    formatting data to strings in reports. This has the advantage of
    allowing partial specializations. The old technique of specializing
    the function template trompeloeil::print(ostream&, const T&) still
    works.

v40

14 Mar 12:29
Compare
Choose a tag to compare
v40
  • Silenced -Wnonnull warning from GCC 9 and newer. Thank you Tony Neubert.

  • Fixed custom reported documentation bug. Thanks Matt Godbolt.

  • Added CMake alias target trompeloeil::trompeloeil. Thank you Leon De Andrade.

  • Documentation markdown fixes. Thank you @offa.

  • Moved all CI builds to github actions. travis-ci and appveyor are no longer used.

  • Moved CI coverage collection to codecov.io

  • Conan recipe is now on https://conan.io/center/trompeloeil
    the old rollbear/stable channel is defunct. Thank you Florian Berchtold.