wateret/mengde

Add unit tests

Closed this issue · 9 comments

Let's add unit tests for each modules.

  • Introduce test framework (Decision : gtest/catch/boost.test)
  • Lua binding
  • Core module - #4 must be preceded
  • Util module

#21 should be preceded for this.

Can we use gtest or build using just a simple c++ program that starts with main() maybe with CTest of CMake

We can automatically add tests with CTest of CMake by scanning source code for Google Test. (https://cmake.org/cmake/help/v3.9/module/GoogleTest.html)
If we plan to use gtest in this project, I will look for ways to use it aggressively, because I'm interested in gtest these days.

I am good with googletest and CTest. :)

Maybe this is more portable. https://github.com/catchorg/Catch2
We should consider this as well.

Possible Options

  • googletest
  • catch2
  • boost.test

I have introduced unit tests with "Boost Unit Test Framework" and applied to CI.

I will close this issue as soon as it gets at least one test for each Lua/Core/Util module.

Now that we have at least one test case for each module, closing. Of course we definately need more test cases.