2out
Object oriented unit testing framework
Intro
The test framework does not should be easy to use. The test framework should help to do everything right. And after that it should be easy to use. :)
Concept
This is a pseudocode (i think this is a eolang :))
object TestApp as Application:
void run():
TestSuite:
TestEqual:
mul: 2, 2
4
TestSkipped:
TestEqual:
mul: 2, 2
5
TestNamed:
"3 * 3 should be equal 9"
TestEqual:
mul: 3, 3
9
TestSuite:
TestEqual:
plus: 2, 2
4
TestSafe:
TestEqual:
div: 1, 0
100500
.run()
Key moment: This is not a code. This is Object composition.
At the time the composition is created, the tests do not start.
Tests start in run()
method.
Using
With cmake
conanfile.txt:
[generators]
cmake
[requires]
2out/0.6@dronmdf/stable
CMakeLists.txt:
INCLUDE(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
build:
$ conan remote add mdf https://api.bintray.com/conan/mdf/2out
$ conan install ~/project --build
$ cmake ~/project
$ make