https://github.com/gammasoft71/tunit
Modern c++17 unit testing framework on Microsoft Windows, Apple macOS, Linux, iOS and android.
https://github.com/gammasoft71/tunit
cpp cpp17 framework ios libraries library macosx multi-platform tdd test test-framework testing unit-tesing unit-test unit-testing unit-testing-framework unit-tests unittest unittests
Last synced: 9 days ago
JSON representation
Modern c++17 unit testing framework on Microsoft Windows, Apple macOS, Linux, iOS and android.
- Host: GitHub
- URL: https://github.com/gammasoft71/tunit
- Owner: gammasoft71
- License: mit
- Created: 2019-02-12T09:19:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-24T06:45:23.000Z (over 3 years ago)
- Last Synced: 2025-04-13T04:12:32.522Z (2 months ago)
- Topics: cpp, cpp17, framework, ios, libraries, library, macosx, multi-platform, tdd, test, test-framework, testing, unit-tesing, unit-test, unit-testing, unit-testing-framework, unit-tests, unittest, unittests
- Language: C++
- Homepage: https://gammasoft71.wixsite.com/tunit
- Size: 2.44 MB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# tunit
**Modern c++17 unit testing framework on Windows, macOS, Linux, iOS and android.**
[](https://gammasoft71.wixsite.com/tunit)
## Continuous Integration build status
| Operating system | Status |
|------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| Windows | [](https://ci.appveyor.com/project/gammasoft71/tunit) |
| macOS | [](https://travis-ci.org/gammasoft71/tunit) |
| Linux | [](https://travis-ci.org/gammasoft71/tunit) |## Download the latest stable tunit version
[](https://sourceforge.net/projects/tunitpro/files/latest/download)
## Features
* An [xUnit](https://en.wikipedia.org/wiki/XUnit) test framework.
* Auto registration of class and method based tests.
* Rich set of assertions.
* ...### For more information see
* [website](https://gammasoft71.wixsite.com/tunit)
* [markdown documentations](docs/home.md)
* [sources](https://github.com/gammasoft71/tunit)
* [Reference Guide](https://codedocs.xyz/gammasoft71/tunit/)## Examples
The classic first application 'Hello World'.
### tunit_hello_world.cpp
```c++
#include
#includeusing namespace std;
using namespace tunit;namespace unit_tests {
class test_class_(hello_world_test) {
public:
void test_method_(create_string_from_literal) {
string s = "Hello, World!";
valid::are_equal(13, s.size());
assert::are_equal("Hello, World!", s);
}
void test_method_(create_string_from_chars) {
string s = {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
valid::are_equal(13, s.size());
string_assert::starts_with("Hello,", s);
string_assert::ends_with(" World!", s);
}
};
}// The main entry point for the application.
int main() {
return console_unit_test().run();
}
```### CMakeLists.txt
```cmake
cmake_minimum_required(VERSION 3.3)project(tunit_hello_world)
find_package(tunit REQUIRED)
add_executable(${PROJECT_NAME} tunit_hello_world.cpp)
target_link_libraries(${PROJECT_NAME} tunit)
```### Output
```
tart 2 tests from 1 test case
Run tests:
SUCCEED hello_world_test.create_string_from_literal (0 ms total)
SUCCEED hello_world_test.create_string_from_chars (0 ms total)Test results:
SUCCEED 2 tests.
End 2 tests from 1 test case ran. (0 ms total)
```## Getting Started
* [Installation](docs/downloads.md) provides download and install documentation.
* [Portability](docs/portability.md) provides information about C++, libraries dependency, Operating System suported, Compilators and Devepment Environment tools.
* [Examples](docs/examples.md) provides some examples.______________________________________________________________________________________________
© 2021 Gammasoft.