https://bugs.kde.org/show_bug.cgi?id=405225
Bug ID: 405225
Summary: Unit-test not discovered when added using
gtest_discover_tests()
Product: kdevelop
Version: git master
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: Build tools: CMake
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 118651
--> https://bugs.kde.org/attachment.cgi?id=118651&action=edit
diff for importTestSuite.{cpp,h}
SUMMARY
Unit-tests produced via gtest_discover_tests() are not discovered by KDevelop.
There seem to be two reasons for that:
- KDevelop is able to discover unit-tests from CMake files given that:
1) There is a CTestTestfile.cmake file in the root of the build directory
2) if that file contains "subdir" directives, unit-tests are searched in
${subdir}/CTestTestfile.cmake (recursively). It seems (?) that include()
directives are not followed.
- Bracket arguments (
https://cmake.org/cmake/help/v3.14/manual/cmake-language.7.html#bracket-argument
) are used to pass command-line arguments to the unit-tests. It seems that the
parser can't interpret those (?).
STEPS TO REPRODUCE
1. Create executable targets with CMake, and pass them to
gtest_discover_tests() with some EXTRA_ARGS directives
2. Run Kdevelop on that project
OBSERVED RESULT
The unit-test view is empty
EXPECTED RESULT
Unit-tests are shown
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 29
(available in About System)
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.55.0
Qt Version: 5.11.3
ADDITIONAL INFORMATION
CTestTestfile.cmake may contain:
include("/home/.../build/unittests/test_foo[1]_include.cmake")
The import seems to skip that. A minimal fix is attached to follow include()
directives.
--
You are receiving this mail because:
You are watching all bug changes.