summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-cov/llvm-cov.test
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-05-07 02:11:23 +0000
committerJustin Bogner <mail@justinbogner.com>2014-05-07 02:11:23 +0000
commitcf27e1b996f290c4ae186fd9060bf5b36302b3ec (patch)
treecb0ea4ac4a1df310d1fe0879dc38bf187e22001d /llvm/test/tools/llvm-cov/llvm-cov.test
parent1a18d7caa3e9b0bf9a64caa9ead2b849dd9070fb (diff)
downloadbcm5719-llvm-cf27e1b996f290c4ae186fd9060bf5b36302b3ec.tar.gz
bcm5719-llvm-cf27e1b996f290c4ae186fd9060bf5b36302b3ec.zip
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. llvm-svn: 208149
Diffstat (limited to 'llvm/test/tools/llvm-cov/llvm-cov.test')
-rw-r--r--llvm/test/tools/llvm-cov/llvm-cov.test6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-cov/llvm-cov.test b/llvm/test/tools/llvm-cov/llvm-cov.test
index 8f57d9a1893..2345f8d51e8 100644
--- a/llvm/test/tools/llvm-cov/llvm-cov.test
+++ b/llvm/test/tools/llvm-cov/llvm-cov.test
@@ -34,6 +34,12 @@ RUN: diff -aub test_objdir.h.gcov test.h.gcov
# With gcov output disabled
RUN: llvm-cov -n test.c | diff -u test_no_output.output -
+# Missing source files. This test is fragile, as it depends on being
+# run before we copy some sources into place in the next test.
+RUN: llvm-cov test_paths.cpp 2>/dev/null | diff -u test_missing.output -
+RUN: diff -aub test_missing.cpp.gcov test.cpp.gcov
+RUN: diff -aub test_missing.h.gcov test.h.gcov
+
# Preserve paths. This mangles the output filenames.
RUN: mkdir -p %t/srcdir/nested_dir
RUN: cp test.cpp test.h %t/srcdir
OpenPOWER on IntegriCloud