diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-04-23 21:44:55 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-04-23 21:44:55 +0000 |
commit | de2703ddfb7730fcfaf718f89b1561a539240a72 (patch) | |
tree | b4b9e4885dc9f8fc282680137e148396b3d224ff /test | |
parent | edcd7c718f9312d3ca6d3501d8b844760b648cd3 (diff) | |
download | llvm-de2703ddfb7730fcfaf718f89b1561a539240a72.tar.gz llvm-de2703ddfb7730fcfaf718f89b1561a539240a72.tar.bz2 llvm-de2703ddfb7730fcfaf718f89b1561a539240a72.tar.xz |
llvm-cov: Add support for gcov's --long-file-names option
GCOV provides an option to prepend output file names with the source
file name, to disambiguate between covered data that's included from
multiple sources. Add a flag to llvm-cov that does the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/tools/llvm-cov/Inputs/test_long_file_names.output | 8 | ||||
-rw-r--r-- | test/tools/llvm-cov/Inputs/test_long_paths.output | 8 | ||||
-rw-r--r-- | test/tools/llvm-cov/llvm-cov.test | 10 |
3 files changed, 26 insertions, 0 deletions
diff --git a/test/tools/llvm-cov/Inputs/test_long_file_names.output b/test/tools/llvm-cov/Inputs/test_long_file_names.output new file mode 100644 index 0000000000..e09f4cb985 --- /dev/null +++ b/test/tools/llvm-cov/Inputs/test_long_file_names.output @@ -0,0 +1,8 @@ +File 'srcdir/./nested_dir/../test.h' +Lines executed:100.00% of 1 +srcdir/./nested_dir/../test.h:creating 'test_paths.cpp##test.h.gcov' + +File 'srcdir/./nested_dir/../test.cpp' +Lines executed:84.21% of 38 +srcdir/./nested_dir/../test.cpp:creating 'test_paths.cpp##test.cpp.gcov' + diff --git a/test/tools/llvm-cov/Inputs/test_long_paths.output b/test/tools/llvm-cov/Inputs/test_long_paths.output new file mode 100644 index 0000000000..376ee5b78d --- /dev/null +++ b/test/tools/llvm-cov/Inputs/test_long_paths.output @@ -0,0 +1,8 @@ +File 'srcdir/./nested_dir/../test.h' +Lines executed:100.00% of 1 +srcdir/./nested_dir/../test.h:creating 'srcdir#^#test_paths.cpp##srcdir#nested_dir#^#test.h.gcov' + +File 'srcdir/./nested_dir/../test.cpp' +Lines executed:84.21% of 38 +srcdir/./nested_dir/../test.cpp:creating 'srcdir#^#test_paths.cpp##srcdir#nested_dir#^#test.cpp.gcov' + diff --git a/test/tools/llvm-cov/llvm-cov.test b/test/tools/llvm-cov/llvm-cov.test index 19d3e5db18..8457aef292 100644 --- a/test/tools/llvm-cov/llvm-cov.test +++ b/test/tools/llvm-cov/llvm-cov.test @@ -43,6 +43,16 @@ RUN: llvm-cov test_paths.cpp | diff -u test_no_preserve_paths.output - RUN: diff -aub test_paths.cpp.gcov test.cpp.gcov RUN: diff -aub test_paths.h.gcov test.h.gcov +# Long file names. +RUN: llvm-cov -l test_paths.cpp | diff -u test_long_file_names.output - +RUN: diff -aub test_paths.cpp.gcov test_paths.cpp##test.cpp.gcov +RUN: diff -aub test_paths.h.gcov test_paths.cpp##test.h.gcov + +# Long file names and preserve paths. +RUN: llvm-cov -lp -gcno test_paths.gcno -gcda test_paths.gcda srcdir/../test_paths.cpp | diff -u test_long_paths.output - +RUN: diff -aub test_paths.cpp.gcov srcdir#^#test_paths.cpp##srcdir#nested_dir#^#test.cpp.gcov +RUN: diff -aub test_paths.h.gcov srcdir#^#test_paths.cpp##srcdir#nested_dir#^#test.h.gcov + # Function summaries. This changes stdout, but not the gcov files. RUN: llvm-cov test.c -f | diff -u test_-f.output - RUN: diff -aub test_no_options.cpp.gcov test.cpp.gcov |