If you would like us to add any more questions here, please contact us via the Contributing page.
No. The intention is that you can provide your own copy of Catch2, via a file call catch.hpp
.
We use the copy of Catch2 and other test frameworks in third_party/ in this project only to run our own tests.
Certainly, if you download a Single Header release of this library, no Catch2 is provided, so you need to provide your own.
Things to say:
- Yes, it's a common problem
- Readability of the output is important
- Someone reviewing a test failure needs to understand the purpose and intent of the test
- Recommendation: write your own formatting that's specific to particular tests - see
- How to do String Conversions
- Tips for Designing Strings for examples.
You may find that your tests fail, even though equivalent Approved and Received files are being compared, if the image file formats being used encode things like the date the file was created. This is because ApprovalTests.cpp's default behaviour is a character-for-character comparison of file content.
If you can use the Qt framework, then we have provided a way to verify the contents of PNG images: please see ApprovalTestsQt::verifyQImage()
in ApprovalTests.cpp.Qt.