Fix and improve CMake test finding and running

Authored by mihac on Jan 16 2018, 9:38 PM.

Description

Fix and improve CMake test finding and running

Summary:
This is a bunch of small changes that together enable running tests from
CMake with support for QtTest and viewing results in the tool view.
The changes include:

  1. Enable listing test cases from tests defined with CMake and QtTest
    • Extract sources for each target from cmake server
    • Use target sources to look for QtTest declarations in them
    • Fix the search for QtTest declarations, so that it works without access to the main() function body
  1. When running tests, parse the output and report results
    • Exctract output directly from the OutputModel, which is long-lived, and not from the shorter-lived OutputJob. The previous method would lose some lines of output.
    • Wait for asynchronous output signals from OutputModel, which again prevents losing some lines of test program output.
  1. A new unit test that checks the cases parsed from source code, using the existing testing project unit_tests_kde.

With these changes, the test suites and individual test cases appear in the
Unit Tests tool view:

Reviewers: KDevelop, apol

Reviewed By: KDevelop, apol

Subscribers: apol, kdevelop-devel

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

Details

Committed
mihacJan 16 2018, 9:41 PM
Reviewer
KDevelop
Differential Revision
D9919: Fix and improve CMake test finding and running
Parents
R32:06298b24fee1: Properly quote expected string value in lldb formatter unittests
Branches
Unknown
Tags
Unknown