CMake: Add "test" target to cmake builds

Always show a test target for cmake projects. This will show even
if there are no tests in the project. But I think it is more annoying
*not* to be able to run tests via the locator when tests are available
than getting an error message when attempting that with a project that
does not have tests.

Task-number: QTCREATORBUG-18323
Change-Id: Iba85aa868cb9bfe6c3f44a7ffff620d081d3082f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2017-06-02 09:11:39 +02:00
parent 9f83808dc0
commit 460e1d7e93
3 changed files with 9 additions and 1 deletions

View File

@@ -404,9 +404,14 @@ QString CMakeBuildStep::installTarget()
return QString("install");
}
QString CMakeBuildStep::testTarget()
{
return QString("test");
}
QStringList CMakeBuildStep::specialTargets()
{
return { allTarget(), cleanTarget(), installTarget() };
return { allTarget(), cleanTarget(), installTarget(), testTarget() };
}
//