我正在使用gcov来衡量我所贡献的c ++库的测试覆盖率.出于某种原因,gcov没有将许多文件中的行识别为可执行文件.在给定文件中的160行中,它会说其中40行是可执行的.例如:
-: 0:Source:../evo/NK.h
-: 0:Graph:test_driver.gcno
-: 0:Data:test_driver.gcda
-: 0:Runs:1
-: 0:Programs:1
-: 1:// This file is part of Empirical, https://github.com/devosoft/Empirical
-: 2:// Copyright (C) Michigan State University, 2016.
-: 3:// Released under the MIT Software license; see doc/LICENSE
-: 4://
-: 5://
-: 6:// This file provides code to build NK-based algorithms.
-: 7:
-: 8:#ifndef EMP_EVO_NK_H
-: 9:#define EMP_EVO_NK_H
-: 10:
-: 11:#include <array>
-: 12:
-: 13:#include "../tools/BitVector.h"
-: 14:#include "../tools/const_utils.h"
-: 15:#include "../tools/Random.h"
-: 16:#include "../tools/vector.h" …Run Code Online (Sandbox Code Playgroud)