This repository has been archived by the owner on May 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Maxime ROUFFET edited this page Mar 1, 2021
·
27 revisions
Even if some say testing is doubting, it was a wise decision to come here. Welcome to the SA-UnitTestHelper wiki!
SA-UnitTestHelper (UTH) is part of the Sapphire tools suite and can be used as an outside module without dependencies.
It is composed of a single header file that provides you a complete set of tools for easier unit testing.
// Init tools for unit testing.
SA_UTH_INIT();
// Run test that compares lhs and rhs using == operator.
SA_UTH_EQ(lhs, rhs);
// Run a test that executes a static function.
SA_UTH_SF(Vec2::Equals, v1, v2);
// Run a test that executes a member function.
SA_UTH_MF(v1, IsEqual, v2);
// Run a test that executes an operator.
SA_UTH_OP(v1, ==, v2);
// Run a group of tests.
SA_UTH_GP(MyGroupOfTest());
// Exit code with all unit test results.
SA_UTH_EXIT();
- Quick and easy macros.
- Set of useful tools: ToString, Random...
- Automatic console output.
- Flexible Callbacks for custom integration of tests processing.
- CMake integration for cross-platform unit testing.
See the Examples/ folder for more detailed examples of use for each features.
Repositories that use SA-UnitTestHelper module: