Eclipse C++ Unit Testing without Unit Testing framework



  • I am looking for some ideas on how to implement a Unit Test framework without any existing unit test tools like Google Test Runner. I am on a closed network without internet access and so whatever method is determined needs to be hand written and configured.



  • There is a lot of documentation of how to build your own Unit Testing Framework, maybe this is a starting point: https://stackoverflow.com/questions/7049329/how-to-write-a-unit-test-framework

    For Eclipse you could look at the code from other frameworks plugins to see how you can make your framework integration better with Eclipse.

    Unit-tests mostly instantiates a class and calls some methods. Then there is a assert function for the result. You could write your own assert library, but I think C++ has one shipped by default in cassert.

    You don't really need a test-runner. Probably a new C++ program with methods that execute code with asserts could be enough. Build, run the separate test program, verify it did not throw an assert exception with a try/catch. Of Course as your program grows a full-blown testing framework will make it easier to read failures.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2