无法获得gcovr来生成覆盖数据

时间:2014-08-20 11:08:09

标签: xcode code-coverage gcovr

使用gcovr 3.2我正在尝试为我使用Xcode 5.0开发和运行的设置单元测试生成代码覆盖率报告。

我已成功配置Xcode以在执行测试后生成.gcda文件,并且我可以使用CoverStory查看结果。

但是,当我尝试使用gcovr生成报告时,不会生成任何内容。通过详细开关,我可以看到它扫描目录中的gcda / gcno文件并找到我期待它的那个。我尝试了各种开关,并将文件放在不同的目录中,没有任何运气。

此处Gcovr generates coverage data for 0 files提出了类似的问题,但未发布任何解决方案。我已经提供了更多细节,希望得到回复。

这是我得到的输出。

$ ls
t1-map.d    t1-map.dia  t1-map.gcda t1-map.gcno t1-map.o

$ gcovr -v -r .

Scanning directory . for gcda/gcno files...
Found 2 files (and will process 1)
Running gcov: 'gcov /Users/Test/temp/coverage/t1-map.gcda --branch-counts --branch-probabilities --preserve-paths --object-directory /Users/Test/temp/coverage' in '/Users/Test/temp/coverage'
Parsing coverage data for file /Users/Test/dev/boost/boost/system/error_code.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/system/error_code.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/system/system_error.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/system/system_error.hpp
Parsing coverage data for file /Users/Test/dev/analysis-pipeline/analysis-services/src/t1-map.cpp
  Filtering coverage data for file /Users/Test/dev/analysis-pipeline/analysis-services/src/t1-map.cpp
Parsing coverage data for file /Users/Test/dev/boost/boost/variant/variant.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/variant/variant.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/aligned_storage.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/aligned_storage.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/variant/static_visitor.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/variant/static_visitor.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/variant/detail/visitation_impl.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/variant/detail/visitation_impl.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/variant/detail/cast_storage.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/variant/detail/cast_storage.hpp
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory
Parsing coverage data for file /Users/Test/dev/boost/boost/variant/detail/initializer.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/variant/detail/initializer.hpp
Parsing coverage data for file /Users/Test/dev/analysis-pipeline/common/include/common/lm-fitter.inl
  Filtering coverage data for file /Users/Test/dev/analysis-pipeline/common/include/common/lm-fitter.inl
Parsing coverage data for file /Users/Test/development/software/utilities/include/utilities/numerical-recipes/utilities.h
  Filtering coverage data for file /Users/Test/development/software/utilities/include/utilities/numerical-recipes/utilities.h
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/iosfwd
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/iosfwd
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/sstream
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/sstream
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/string
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/string
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/streambuf
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/streambuf
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/algorithm
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/algorithm
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/type_traits
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/type_traits
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/iterator
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/iterator
Parsing coverage data for file /Users/Test/dev/boost/boost/log/utility/formatting_ostream.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/utility/formatting_ostream.hpp
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/ios
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/ios
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/__locale
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/__locale
Parsing coverage data for file /Users/Test/dev/boost/boost/log/detail/attachable_sstream_buf.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/detail/attachable_sstream_buf.hpp
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/ostream
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/ostream
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/locale
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/locale
Parsing coverage data for file /Users/Test/development/software/utilities/include/utilities/numerical-recipes/mrqmin.inl
  Filtering coverage data for file /Users/Test/development/software/utilities/include/utilities/numerical-recipes/mrqmin.inl
Parsing coverage data for file /Users/Test/development/software/utilities/include/utilities/numerical-recipes/mrqcof.inl
  Filtering coverage data for file /Users/Test/development/software/utilities/include/utilities/numerical-recipes/mrqcof.inl
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/cmath
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/cmath
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/vector
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/vector
Parsing coverage data for file /Users/Test/dev/boost/boost/log/utility/string_literal.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/utility/string_literal.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/variant/get.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/variant/get.hpp
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/exception
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/exception
Parsing coverage data for file /Users/Test/dev/boost/boost/throw_exception.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/throw_exception.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/exception/exception.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/exception/exception.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/utility/addressof.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/utility/addressof.hpp
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/__split_buffer
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/__split_buffer
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/limits
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/limits
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/typeinfo
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/typeinfo
Parsing coverage data for file /Users/Test/dev/boost/boost/log/sources/record_ostream.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/sources/record_ostream.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/move/utility.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/move/utility.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/log/sources/basic_logger.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/sources/basic_logger.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/log/core/core.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/core/core.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/smart_ptr/shared_ptr.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/smart_ptr/shared_ptr.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/log/detail/locks.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/detail/locks.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/log/core/record.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/core/record.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/log/sources/threading_models.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/sources/threading_models.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/log/detail/light_rw_mutex.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/detail/light_rw_mutex.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/log/sources/severity_feature.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/sources/severity_feature.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/parameter/keyword.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/parameter/keyword.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/parameter/aux_/default.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/parameter/aux_/default.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/parameter/aux_/tagged_argument.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/parameter/aux_/tagged_argument.hpp
Parsing coverage data for file /Users/Test/dev/boost/boost/log/attributes/named_scope.hpp
  Filtering coverage data for file /Users/Test/dev/boost/boost/log/attributes/named_scope.hpp
Parsing coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/stdexcept
  Filtering coverage data for file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/stdexcept
Gathered coveraged data for 0 files
------------------------------------------------------------------------------
                           GCC Code Coverage Report
Directory: .
------------------------------------------------------------------------------
File                                       Lines    Exec  Cover   Missing
------------------------------------------------------------------------------
------------------------------------------------------------------------------
TOTAL                                          0       0    --%
------------------------------------------------------------------------------

2 个答案:

答案 0 :(得分:3)

对于任何可能感兴趣的人,我最终都会想出来。

从目录/ Users / Test / development我输入以下命令:

gcovr --html --html-details -o output-file-name.html -v -g -k -r ~/development/ .

源文件位于'〜/ development /'下的各种目录中。在我之前的尝试中似乎无法找到源文件。

答案 1 :(得分:-1)