View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015683CMakeCMakepublic2015-08-05 03:052016-06-10 14:31
Reporterj.kreuzberger 
Assigned ToKitware Robot 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionmoved 
PlatformallOSallOS Version
Product VersionCMake 3.2.2 
Target VersionFixed in Version 
Summary0015683: Extend --trace to --coverage mode for detection of "dead" cmake code
Descriptionmy intention is to find "dead" cmake script code in the project for cleanup and maintainance of the scripts.

I have adapted the gcovr script to parse the cmake script output in --trace mode to detected "code coverage" and write text or html output. Results attached below.

No i have some issues:

- The trace mode does report multi line statements as "one line" statement.
This should be reported as RANGE (e.g. not with just one line number, with start and end line number (e.g. filename(3:5): )

- the commands closing are not considered in trace output. so to each if(), macro() or other commands, the enclosing endif(), endmacro() etc are not "covered". This should be also traced or covered


For complete finalisation is must reload the file and mark the commented and blank lines as "covered". But thats ok for me for the covering issues.

So my suggestion would be to extend the trace mode or create an additional coverage mode.
Steps To Reproducecmake with --trace output activated and multiline statements like

set( MY_VAR
     test.cpp
     test.h
     ...
)

if( WIN32 )
  set( MYVAR2 )
endif()

Additional InformationThe attached files are sample output from the adapted gcovr script.
Script cant be published cause i have to clarify the copyright issues with the "original" script holders.

TagsNo tags attached.
Attached Fileshtml file icon cmake_coverage.tinyxml2_tinyxml2sources.txt.html [^] (7,727 bytes) 2015-08-05 03:05

 Relationships

  Notes
(0042817)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-08-05 03:05 j.kreuzberger New Issue
2015-08-05 03:05 j.kreuzberger File Added: cmake_coverage.tinyxml2_tinyxml2sources.txt.html
2016-06-10 14:29 Kitware Robot Note Added: 0042817
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team