![]() |
Specs
Beautiful C++ Test Framework
|
Getting started with Specs
is incredibly easy.
Especially if you manage your C++ dependencies using xmake
or vcpkg
See Installing Specs to get started.
One core difference between Specs
and other testing frameworks is that Specs
does not provide any assertion functions or macros.
Instead, Specs
is designed to work with any assertion library (or any C++ exception).
By default, any C++ exception thrown during a test will be caught and reported as a failure.
If the exception is a
std::exception
, thewhat()
will be displayed as a failure message.If the exception is a literal C-string, the string will be displayed as a failure message.
Snowhouse is a lovely C++ assertion library.
It uses an AssertThat()
style syntax, which is very readable.
To setup the Specs
adapter for Snowhouse
, include <Specs/Snowhouse/Main.h>
in your main.cpp
Then, in each spec file, you may include <Specs/Snowhouse.h>
as a shorthand for including the snowhouse
headers.
Visit the Snowhouse GitHub page for more examples:
libassert ia another great C++ assertion library.
Marketed as "_The most over-engineered and overpowered C++ assertion library._", it provided a simple assert
syntax.
Visit the libassert GitHub page for more examples: