Fix running isolated tests on a clean build

Authored by nalvarez on Aug 26 2016, 1:32 PM.

Description

Fix running isolated tests on a clean build

Summary:
The add_akonadi_isolated_test CMake macro was searching for akonaditest
using find_program. This is the right thing to do when the macro is called
by a separate project that uses akonadi, since then it is already in the
system as a required dependency.

However, this will not work when building akonadi itself for the first time,
where akonadi is not installed in the system yet. akonaditest will not be
found, since it will be built and installed by this same project, and
that's at make time, long after this macro runs.

This patch checks if we're building akonadi itself, and if so, it sets the
test runner as just "akonaditest". When using the
add_test(NAME foo COMMAND akonaditest) syntax, CMake will detect that it's
a target name and replace it with the location of the executable that will
be built.

Differential Revision: https://phabricator.kde.org/D2431

Details

Committed
dvratilAug 26 2016, 1:36 PM
Differential Revision
D2431: Fix running isolated tests on a clean build
Parents
R165:7997c450984e: Display selected, newly created tags
Branches
Unknown
Tags
Unknown
References
tag: v16.08.1