vendredi 27 mars 2015

How can generic programs in C++11 be properly tested

I usually use Boost.Test for writing unit tests for my code. My tests cover not only the positive path, but also I write tests to be certain exceptions will be thrown when needed.


Since C++11 introduced Concepts and noexcept I had been developing more advanced generic program expressions to detect errors at compile time when possible.


How can I test my generic programming functions are catching the right problems? So far, I'm using a SH script running a set of programs that are expected to fail compilation and collecting the results in a file.


Is there any better approach? Is any Testing tool including support for testing code wrote to fail compilation?


Aucun commentaire:

Enregistrer un commentaire