-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ unit test framework with Catch #1019
Conversation
BTW, rewriting the point vector unit test allows me to detect an issue in PointVector::getNormalized() 😄 |
Run |
|
||
/** | ||
* Description of test_trace' <p> | ||
* Aim: simple test of \ref MeasureOfStraighLines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you mean "catch functionnalities" here.
thx. done. |
Sinon, dans catch, ils spécifient qu'il faut mettre le #define and On fait comme ça, où on remettra #define et #include catch dans chacun Le 28/08/2015 14:30, David Coeurjolly a écrit :
|
We could easily create a |
…ple compilation of catch
Done. |
According to the pointed doc, it seems the define main+include sould be in one source code only, not a header. Then, we only do the include at other places. Have I misunderstood something ? |
Yes but we don't want to collect all unit tests into a unique executable... |
I don't see any better solution.. |
I was just wondering if the catch source should be compiled within DGtal library (then we can still split tests). The problem is that we don't want to add sources to the library (in fact, we would like to get rid of all cpp, no ?). Perhaps it would be better to have a DGtalTest library. What do you think ? |
The problem is more related to the magical Unless we want to gather all unit tests into a single exe (and using the filter features to focus on the API we want to test), I think there is nothing we can do (beside the #pragma thing that could speed up the build on modern compilers). |
Ok. We just have to watch the compilation time when there will be many "catchy" tests. |
C++ unit test framework with Catch
Enables catch unit test system (https://github.com/philsquared/Catch) in DGtal.
The idea is to simplify unit test design in DGtal with a "single-header" but complete framework.
For instance, a
REQUIRE( a == b);
in a test case section checks thata
equalsb
. If the test fails, the values ofa
andb
are traced out with neat messages.Basically it would replace what we usually do:
Catch also allows test case filtering and timing...
Please have a look to
testPointVector-catch.cpp
which is a catch version oftestPointVector.cpp