Port to ecm_add_test to stop skipping all test runs
ClosedPublic

Authored by rkflx on Aug 19 2018, 8:54 PM.

Details

Summary

b9aee44dfbd8 changed ECM_VERSION from 1.7.0 to 5.39.0. This caused the
tests to be installed to build/bin instead of build/tests/auto, but
also made ctest and make test skip running all tests:

$ make test
...
Start  1: imagescalertest
Could not find executable imagescalertest
Looked in the following places:
imagescalertest
imagescalertest
Release/imagescalertest
Release/imagescalertest
Debug/imagescalertest
Debug/imagescalertest
MinSizeRel/imagescalertest
MinSizeRel/imagescalertest
RelWithDebInfo/imagescalertest
RelWithDebInfo/imagescalertest
Deployment/imagescalertest
Deployment/imagescalertest
Development/imagescalertest
Development/imagescalertest
Unable to find executable: imagescalertest
...

The CI is also skipping all tests since that commit.

Using ecm_add_test instead of manually adding the tests fixes the
issue.

Test Plan

Remove the complete build dir and run cmake. After applying the patch
and rebuilding, make test should successfully run all tests again.

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rkflx requested review of this revision.Aug 19 2018, 8:54 PM
rkflx created this revision.
muhlenpfordt accepted this revision.Aug 20 2018, 11:58 AM
muhlenpfordt added a subscriber: muhlenpfordt.

make test regained all Gwenview tests. CMake code looks good to me (compared e.g. to Dolphin).
(UrlUtilsTest still fails for me in 50% of the runs because of returning krarc instead of zip/cbz, but that's nothing new.)


On my system an additional test appstreamtest is automatically created (no Gwenview source file). Isn't this created for you (because your log says Start 1: imagescalertest)?

     Start  1: appstreamtest
1/19 Test  #1: appstreamtest ....................   Passed    0.01 sec
     Start  2: imagescalertest
2/19 Test  #2: imagescalertest ..................   Passed    0.67 sec
This revision is now accepted and ready to land.Aug 20 2018, 11:58 AM
ngraham accepted this revision.Aug 20 2018, 1:49 PM
ngraham added a subscriber: ngraham.

+1, seems like the correct solution.

rkflx added a comment.Aug 20 2018, 4:38 PM

On my system an additional test appstreamtest is automatically created (no Gwenview source file). Isn't this created for you (because your log says Start 1: imagescalertest)?

For this to work it's necessary to install appstreamcli, which I should probably do at some point…

(BTW, I guess you already know about README_REMOTE_TESTS and fetch_testing_raw.sh?)

This revision was automatically updated to reflect the committed changes.