celix icon indicating copy to clipboard operation
celix copied to clipboard

Refactor CppUTest tests to gtest

Open rlenferink opened this issue 6 years ago • 1 comments

Currently CppUTest is used for testing and mocking and although this framework works fine, I would be handier to move to gtest( google test) for a few reasons:

  1. more easier to integrate as a external project
  2. much more heavily used than CppUTest
  3. integrated support in the CLion IDE. This means that the IDE supports directly running/debugging individually testcases/testsuites.

This would also mean that the cpputest mocks should be removed. This can be done as long as we keep the code coverage as good as intact.


Original creation date: 06/May/2018 Reporter: @pnoltes

rlenferink avatar Sep 28 '19 14:09 rlenferink

Comment by Johan:

Potential issues would be:

  • CppUTest is easy to build for an end-user and is typically distributed with the package manager. For gtest+gmock this is not the case and the end-user needs to build and install from source by themselves. Alternatively Celix could bundle the binaries and headers, which would add work on the project side instead of the user side.
  • gmock does not support mocking C functions exactly, there are ways of working around this[0][1] which either introduces extra boilerplate or an extra dependency.

[0] https://github.com/hjagodzinski/C-Mock [1] https://stackoverflow.com/questions/31989040/can-gmock-be-used-for-stubbing-c-functions

rlenferink avatar Sep 28 '19 14:09 rlenferink