I have some complicated game logic components. I have been keeping refactoring them for a while and I found it’s really hard to iterate without some unit test coverage.
I do have unit test coverage for my some standalone classes that do not include any Urho3D class. But this one has some dependency on Urho3D (given input of a character’s state, test current animation, blending, etc). And simply use something like
add_executable(MyCustomTest my_unittest.cc ${urho3d_src_cc} ${urho3d_src_h})
target_link_libraries(MyCustomTest gtest gtest_main)
does not work since Urho3D CMake has specific macro like define_source_files
and setup_main_executable
to add all the dependencies.
I was wondering if anyone is using any unit test and could provide a sample CMakeList?