KTX-Software icon indicating copy to clipboard operation
KTX-Software copied to clipboard

RUN_TESTS target has no dependencies on the programs it runs

Open MarkCallow opened this issue 4 years ago • 5 comments

So the tests often fail because the executables aren't found as they haven't been built. It must have dependencies on all programs it is testing.

MarkCallow avatar Jul 12 '20 16:07 MarkCallow

@atteneder please take a look at this and #281 urgently. Both are costing me a lot of wasted time.

MarkCallow avatar Jul 23 '20 17:07 MarkCallow

Unfortunately this is a known flaw in CMake without a proper solution: https://gitlab.kitware.com/cmake/cmake/-/issues/8774

To avoid missing exes, I suggest:

  1. Run the ALL_BUILD target before running tests
  2. Create a custom target with dependencies on all test executables and run this target before running tests

Let me know if you think option 2 is in any way useful/an improvement, in which case I'll make a PR.

Otherwise there's nothing left to do other than upvoting/commenting the original issue.

atteneder avatar Aug 26 '20 18:08 atteneder

Running ALL_BUILD works. Is there some advantage to a custom target that I'm missing? I don't see any benefit over ALL_BUILD.

I've upvoted the CMake issue. I'll leave this open to document the problem and hopefully stem a tide of duplicate reports.

MarkCallow avatar Aug 26 '20 18:08 MarkCallow

Only advantage is, it would build only the executables required for testing and not other things (like the loadtest apps). Downside: CMake config/Xcode project getting a bit more bloated.

atteneder avatar Aug 26 '20 19:08 atteneder

Ping @atteneder. This still bites me regularly when I forget to first build "package". Please try to fix it.

MarkCallow avatar Feb 20 '22 12:02 MarkCallow