libosmscout
libosmscout copied to clipboard
Rewrite tests to make use of an existing test framework
I would suggest to use https://github.com/philsquared/Catch:
- Looks good
- Allows to use it with one header copied into the project
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Added catch header. Rewrote 3 tests. More have to follow. Since verybody can now convert further tests, I'm givingh away ownership of the issue.
Test still likely to get transformed to new test framework:
- EncodeNumber.cpp
- FileScannerWriter.cpp
- GeoBox.cpp
- GeoCoordParse.cpp
- Geometry.cpp
- MapRotate.cpp
- NumberSet.cpp
- OSTAndOSSCheck.cpp
- ScanConversion.cpp
- TransPolygon.cpp
- WStringStringConversion.cpp
Others tests are designed to be called manually or have no success/fail criteria or just measure performance.
Updated list:
- EncodeNumber.cpp
- FileScannerWriter.cpp
- GeoCoordParse.cpp
- MapRotate.cpp
- NumberSet.cpp
- OSTAndOSSCheck.cpp
- TransPolygon.cpp
- WStringStringConversion.cpp
I looked at the code of the tests and found even more tests without catch framework. Or did I do something wrong?
- CachePerformance
- CalculateResolution
- ClientQtThreading
- CoordinateEncoding
- DrawTextQt
- EncodeNumber (commit d18af864e75df7ef08fa70f41d62f666e2f43242)
- FeatureLabelTest
- FileScannerWriter (commit 08bb33a7cb76cd42ee384e65aa5ee409f3e024c8)
- GeoCoordParse (commit 9ea8219da50d3af212778bc8cf56a28788e8ea89)
- LocationLookupTest
- MapRotate (commit f5fac89a6b02304629afbf37b1e2a30312f92f6a)
- MultiDBRouting
- NumberSet (commit 5cf1a3788d982cb0139961d9f12bb265fcb93096)
- NumberSetPerformance
- OSTAndOSSCheck
- QtFileDownloader
- ReaderScannerPerformance
- ThreadedDatabase
- TransPolygon (commit 792443abd426ac4aaa17e445355f558b1ab7926d)
- WorkQueue
- WStringStringConversion (commit a4d21d3132fe24399e8d32a3726ddb27ef32b7ff)
Edit: For commits see PR #310
There are some tests, that act as classical automatic test suites because they do not have a defined result but act as base for manual tests to see if thing have degraded (like e.g. CachePerformance).
I appreciate that you have taken the time to move tests to catch. This is "no fun" work. Thank you!
Note that some tests will fail under MSYS, because of limitations of MSYS - like not having proper locale support. Because of this tests are not executed under all platforms - which is something we should fix. Exclude only those that under a platform that are known to fail and enable everything else.
If I know which ones don't work, I can also exclude them under CMake.
I'll take a look.
The failing tests under MSYS are:
test('Check rotation of maps', MapRotate) test('Check string utils', StringUtils) test('Check WString<=>String conversion code', WStringStringConversion)
See #928 for a build filtering them and activating MSYS tests for meson.
Fix: commit f739751d900fb30c92b113b0ac41f7c468a34614