https://github.com/mrtkp9993/unittestcpp
Simple header-only C++ library for unit-testing.
https://github.com/mrtkp9993/unittestcpp
cpp cpp-library cpp11 header-only testing testing-tools
Last synced: 11 months ago
JSON representation
Simple header-only C++ library for unit-testing.
- Host: GitHub
- URL: https://github.com/mrtkp9993/unittestcpp
- Owner: mrtkp9993
- License: gpl-3.0
- Created: 2020-10-16T17:00:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-08T19:23:53.000Z (about 5 years ago)
- Last Synced: 2025-03-31T11:51:09.608Z (about 1 year ago)
- Topics: cpp, cpp-library, cpp11, header-only, testing, testing-tools
- Language: C++
- Homepage:
- Size: 14.6 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unit Test C++
Header-only simple unit-testing library for C++.
[](https://zenodo.org/badge/latestdoi/304688740)
## Usage
Just include ```test.hpp``` in your app and use it like in ```main.cpp```:
```c++
#include
#include "test.hpp"
int main() {
std::vector> test_funcs = {
[]() { return 1 == 1; }, // TEST 1
[]() { return !(1 == 2); }, // TEST 2
[]() { return 1 == 2; } // TEST 3
};
Test tests(test_funcs);
tests.Run();
return 0;
}
```
Example result:
```
Test 3 FAILED
Run completed, # of failed tests/total tests: 1/3
```