Home

trompeloeil

Trompeloeil is a modern, open-source mocking framework for C++ used to facilitate unit testing by simulating dependencies and verifying interactions with them. It is designed to help tests focus on behavior by ensuring that the code under test communicates with its collaborators in the expected way.

Implemented as a header-only library, trompeloeil is designed to be easy to drop into existing projects and

The framework provides a domain-specific language based on C++ templates and operator overloading to declare expectations

Mock targets typically include interfaces or classes with virtual functions; trompeloeil provides mechanisms to declare mocks,

Additional features include argument matchers for flexible comparisons, support for sequencing and strict versus lenient expectations,

Development and licensing: trompeloeil is hosted on GitHub as an open-source project and is distributed under

work
with
common
testing
frameworks
such
as
Google
Test
and
Catch2.
The
library
emphasizes
a
lightweight
integration
model
and
aims
to
minimize
external
dependencies
beyond
the
C++
standard
library.
describing
which
calls
are
allowed,
with
what
arguments,
in
what
order,
and
what
they
should
return
or
do.
This
approach
yields
expressive,
type-safe
test
specifications
that
are
checked
at
runtime.
set
up
expectations
for
member
functions
and
free
functions,
and
verify
call
counts,
argument
matching,
and
call
order.
The
framework
supports
configuring
return
values,
actions,
and
side
effects
to
simulate
realistic
behavior.
and
detailed
failure
messages
when
expectations
are
not
met.
Trompeloeil
is
intended
to
be
portable
across
platforms
and
compilers
supporting
C++11
and
later.
a
permissive
license,
reflecting
ongoing
community
maintenance
and
contribution.