![]() |
Specs
Beautiful C++ Test Framework
|
It's time to run your tests!
This assumes that you have completed the steps outlines in:
- âŦī¸ Installing Specs
- âī¸ Writing Tests
You might also be interested in using the recommended đ Project Layout.
You should already have a binary/executable target in your xmake
or CMake
/vcpkg
project.
You should already have a .cpp
file in your project which includes the <Specs/Main.h>
header file.
âšī¸ Reminders
- The
<Specs/Main.h>
header file includes amain()
function which runs your tests.- The
<Specs/Main.h>
header should only be included ONCE in your project.
- e.g. you may want to have a
main.cpp
which includes<Specs/Main.h>
And if you're using
snowhouse
, the<Specs/Snowhouse/Setup.h>
should also only be included ONCE in your project.
Simpy run your project's executable target!
By default, the executable will run any tests defined in your executable's project.
If there are none, it will print No tests found.
and print the command line options.
If tests are found, it will run them!
Return Codes
1
response code will be returned if any tests fail0
response code will be returned if all tests pass OR if no tests were found
To view a list of the currently supported command-line arguments, run your executable with the /-h--help
option.
The following is an example of the help documentation:
Note: the above might not be up-to-date. Run your executable with the
/-h--help
option to see the latest help documentation.
To learn more about using command-line options, see âļī¸ Command-Line Interface.
By default, Specs
uses a test runner which runs all tests in the order that they were defined.
To learn more about the available test runners (or how to make your own), see đī¸ Test Runners.
By default, Specs
uses a test reporter which prints test results to the console.
To learn more about the available test reporters (or how to make your own), see đ° Test Reporters.