dimanche 31 janvier 2016

Unit test framework for c++11 like NUnit

Coming from the managed code world with NUnit as unit testing framework.

I've found that there is a jungle of unit test frameworks out there that more or less covers some of the usecases I need(a little disappointing but not bad):

Unit Testing framework for C++

State of the art C++ Unit Testing?

Comparison of c++ unit test frameworks

http://ift.tt/1RU0Tai

How do you implement unit-testing in large scale C++ projects?

http://ift.tt/1xB2ZlV

http://ift.tt/1P5Uymn

But there are several problems in those answers as mentioned below:

  • Mostly opinion based, as they don't actually tell us about the features the recommendations fulfill
  • Old, most of these articles are mentioned before c++ 11 standard and therefore these answers are not refurbished with new standards
  • Incomplete, even when you visit the documentations of those aforementioned libraries, their docs seems to be inadequate and therefore inconclusive. It looks like that someone has to actually experience them in order to know their features.

So I've decided to ask such question again even though it's generally considered off-topic(but not in this case).

Well back to the topic, the features that I require are mentioned below:

  • It should be very flexible, or at least flexible enough, to allow me choose the test cases or test suites interactively(GUI) as well as in batch mode via command line.
  • Well defined, There should be enough macro defined definitions in the unit test framework for separation of test cases and test suites as well as different required assertions that are available in an standard unit test framework(e.g assert true false exception empty or null not empty or not null)
  • Self-sustainable unit tests are very good but MAIN LESS unit tests are preferred, which could be ran in a batch with a shell(bat) script using single convention and a bunch of shared(dynamic) portable libraries(just like NUnit), so it should be either self sustaining or main less.
  • IDE support, which is important too, because it eases the development process of these test cases as well as test running them(testing the testcase!)
    • Good documentation: it is very much preferred if the unit test framework is one go and doesn't require grinding to learn the concepts
  • Also any other features that adds to the ease of arranging, writing or performing those test cases are welcome.

    The description of the problem might be a little remote as I have less experience in c++ code compared to managed code(c# java or etc which compile to intermediate binaries making them easy to interact)

Aucun commentaire:

Enregistrer un commentaire