libosmscout icon indicating copy to clipboard operation
libosmscout copied to clipboard

Rewrite tests to make use of an existing test framework

Open Framstag opened this issue 8 years ago • 9 comments

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.

Framstag avatar May 07 '17 11:05 Framstag

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.

Framstag avatar Jun 22 '17 12:06 Framstag

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.

Framstag avatar Oct 01 '17 15:10 Framstag

Updated list:

  • EncodeNumber.cpp
  • FileScannerWriter.cpp
  • GeoCoordParse.cpp
  • MapRotate.cpp
  • NumberSet.cpp
  • OSTAndOSSCheck.cpp
  • TransPolygon.cpp
  • WStringStringConversion.cpp

Framstag avatar Sep 20 '20 15:09 Framstag

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

OgreTransporter avatar Sep 28 '20 11:09 OgreTransporter

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.

Framstag avatar Sep 28 '20 16:09 Framstag

If I know which ones don't work, I can also exclude them under CMake.

OgreTransporter avatar Sep 29 '20 11:09 OgreTransporter

I'll take a look.

Framstag avatar Sep 29 '20 17:09 Framstag

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.

Framstag avatar Sep 29 '20 18:09 Framstag

Fix: commit f739751d900fb30c92b113b0ac41f7c468a34614

OgreTransporter avatar Sep 30 '20 06:09 OgreTransporter