https://github.com/craflin/mingtest
A minimalistic C++ unit test framework
https://github.com/craflin/mingtest
gtest test testing unit-testing
Last synced: 5 months ago
JSON representation
A minimalistic C++ unit test framework
- Host: GitHub
- URL: https://github.com/craflin/mingtest
- Owner: craflin
- License: mit
- Created: 2019-04-07T15:25:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T14:00:40.000Z (about 2 years ago)
- Last Synced: 2024-05-07T13:03:27.868Z (about 2 years ago)
- Topics: gtest, test, testing, unit-testing
- Language: C++
- Homepage:
- Size: 68.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ming Test
[](http://xaws6t1emwa2m5pr.myfritz.net:8080/job/craflin/job/mingtest/job/master/)
Ming Test is a minimalistic C++ unit test framework and a "drop in" replacement for the gtest (and the gtest_main) library. Contrarily to google test, it compiles quickly, does some basic memory consistency checking, does not depend on modern C++, does not conflict with other libraries, does not cause warnings when evaluating simple expressions and does not interfere with debugging.
Features:
* Very small include header that does not include system or standard library headers
* Easily integratable in CMake projects
* No dependency on C++11
* JUnit test report generation
* Memory checking on Windows based on `_CrtSetDbgFlag`
* No catching of unexpected exceptions when launched in a debugger
* Breaking at failed assertions when running in a debugger
## Example
Write C++ code like this:
```cpp
#include
TEST(Example, TestName1)
{
int a = 32;
int b = 32;
EXPECT_TRUE(a == b);
}
TEST(Example, TestName2)
{
int a = 32;
int b = 33;
EXPECT_FALSE(a == b);
}
```
... and build it as an executable. Link it against `gtest` and `gtest_main`. Then launch the executable to run the test. You can also use the assertion macros `EXPECT_THROW` and `EXPECT_ANY_THROW`. (And some rather pointless macros like `EXPECT_EQ`, `EXPECT_NE`, `EXPECT_GE`, `EXPECT_GT`, `EXPECT_LE`, `EXPECT_LT` and `EXPECT_NO_THROW` if you like.)