diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-05-07 02:11:23 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-05-07 02:11:23 +0000 |
commit | c92330c18ce2f7015f0db88e4bfce3d253fa3c57 (patch) | |
tree | ae700f9e5977fb7a1bc760e4f2746b9b2350379b /test/tools/llvm-cov/Inputs | |
parent | 56d05e468cdfd4ad195f264974f1b841bc4ca785 (diff) | |
download | llvm-c92330c18ce2f7015f0db88e4bfce3d253fa3c57.tar.gz llvm-c92330c18ce2f7015f0db88e4bfce3d253fa3c57.tar.bz2 llvm-c92330c18ce2f7015f0db88e4bfce3d253fa3c57.tar.xz |
llvm-cov: Handle missing source files as GCOV does
If the source files referenced by a gcno file are missing, gcov
outputs a coverage file where every line is simply /*EOF*/. This also
occurs for lines in the coverage that are past the end of a file that
is found.
This change mimics gcov.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tools/llvm-cov/Inputs')
-rw-r--r-- | test/tools/llvm-cov/Inputs/test_missing.cpp.gcov | 77 | ||||
-rw-r--r-- | test/tools/llvm-cov/Inputs/test_missing.h.gcov | 6 | ||||
-rw-r--r-- | test/tools/llvm-cov/Inputs/test_missing.output | 8 |
3 files changed, 91 insertions, 0 deletions
diff --git a/test/tools/llvm-cov/Inputs/test_missing.cpp.gcov b/test/tools/llvm-cov/Inputs/test_missing.cpp.gcov new file mode 100644 index 0000000000..1c138e4258 --- /dev/null +++ b/test/tools/llvm-cov/Inputs/test_missing.cpp.gcov @@ -0,0 +1,77 @@ + -: 0:Source:srcdir/./nested_dir/../test.cpp + -: 0:Graph:test_paths.gcno + -: 0:Data:test_paths.gcda + -: 0:Runs:3 + -: 0:Programs:1 + -: 1:/*EOF*/ + -: 2:/*EOF*/ + -: 3:/*EOF*/ + -: 4:/*EOF*/ + -: 5:/*EOF*/ + -: 6:/*EOF*/ + -: 7:/*EOF*/ + -: 8:/*EOF*/ + -: 9:/*EOF*/ +12884901888: 10:/*EOF*/ + -: 11:/*EOF*/ + #####: 12:/*EOF*/ + -: 13:/*EOF*/ + -: 14:/*EOF*/ + #####: 15:/*EOF*/ + -: 16:/*EOF*/ + -: 17:/*EOF*/ + -: 18:/*EOF*/ + 3: 19:/*EOF*/ + 3: 20:/*EOF*/ + -: 21:/*EOF*/ + -: 22:/*EOF*/ + -: 23:/*EOF*/ + #####: 24:/*EOF*/ + #####: 25:/*EOF*/ + -: 26:/*EOF*/ + -: 27:/*EOF*/ + 12: 28:/*EOF*/ + 12: 29:/*EOF*/ + 12: 30:/*EOF*/ + -: 31:/*EOF*/ + -: 32:/*EOF*/ + 21: 33:/*EOF*/ + 36: 34:/*EOF*/ + 18: 35:/*EOF*/ + 3: 36:/*EOF*/ + -: 37:/*EOF*/ + -: 38:/*EOF*/ + 3: 39:/*EOF*/ + -: 40:/*EOF*/ + 3: 41:/*EOF*/ + 3: 42:/*EOF*/ + 3: 43:/*EOF*/ + 3: 44:/*EOF*/ + 3: 45:/*EOF*/ + 3: 46:/*EOF*/ + #####: 47:/*EOF*/ + #####: 48:/*EOF*/ + -: 49:/*EOF*/ + -: 50:/*EOF*/ + 66: 51:/*EOF*/ + 30: 52:/*EOF*/ + -: 53:/*EOF*/ + 6: 54:/*EOF*/ + 6: 55:/*EOF*/ + -: 56:/*EOF*/ + -: 57:/*EOF*/ + 3: 58:/*EOF*/ + 3: 59:/*EOF*/ + -: 60:/*EOF*/ + 9: 61:/*EOF*/ + 9: 62:/*EOF*/ + -: 63:/*EOF*/ + 12: 64:/*EOF*/ + 12: 65:/*EOF*/ + 30: 66:/*EOF*/ + -: 67:/*EOF*/ + 3: 68:/*EOF*/ +25769803782: 69:/*EOF*/ +12884901888: 70:/*EOF*/ + -: 71:/*EOF*/ + 3: 72:/*EOF*/ diff --git a/test/tools/llvm-cov/Inputs/test_missing.h.gcov b/test/tools/llvm-cov/Inputs/test_missing.h.gcov new file mode 100644 index 0000000000..d500e86196 --- /dev/null +++ b/test/tools/llvm-cov/Inputs/test_missing.h.gcov @@ -0,0 +1,6 @@ + -: 0:Source:srcdir/./nested_dir/../test.h + -: 0:Graph:test_paths.gcno + -: 0:Data:test_paths.gcda + -: 0:Runs:3 + -: 0:Programs:1 + 6: 1:/*EOF*/ diff --git a/test/tools/llvm-cov/Inputs/test_missing.output b/test/tools/llvm-cov/Inputs/test_missing.output new file mode 100644 index 0000000000..ada0c36030 --- /dev/null +++ b/test/tools/llvm-cov/Inputs/test_missing.output @@ -0,0 +1,8 @@ +File 'srcdir/./nested_dir/../test.h' +Lines executed:100.00% of 1 +srcdir/./nested_dir/../test.h:creating 'test.h.gcov' + +File 'srcdir/./nested_dir/../test.cpp' +Lines executed:84.21% of 38 +srcdir/./nested_dir/../test.cpp:creating 'test.cpp.gcov' + |