From 257ed1ed698011f1c23f47ca4f1c5f4cf4efbd41 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Tue, 18 Feb 2014 09:19:48 +0000 Subject: llvm-cov: Support gcov's extermely lenient treatment of -o In gcov, the -o flag can accept either a directory or a file name. When given a directory, the gcda and gcno files are expected to be in that directory. When given a file, the gcda and gcno files are expected to be named based on the stem of that file. Non-existent paths are treated as files. This implements compatible behaviour. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201555 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tools/llvm-cov/llvm-cov.test | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/tools/llvm-cov/llvm-cov.test') diff --git a/test/tools/llvm-cov/llvm-cov.test b/test/tools/llvm-cov/llvm-cov.test index c52a981522..afd657be24 100644 --- a/test/tools/llvm-cov/llvm-cov.test +++ b/test/tools/llvm-cov/llvm-cov.test @@ -21,6 +21,16 @@ RUN: llvm-cov -o objdir test.c | diff -u test_no_options.output - RUN: diff -aub test_objdir.cpp.gcov test.cpp.gcov RUN: diff -aub test_objdir.h.gcov test.h.gcov +# Specifying an object file +RUN: llvm-cov -o objdir/test.o test.c | diff -u test_no_options.output - +RUN: diff -aub test_objdir.cpp.gcov test.cpp.gcov +RUN: diff -aub test_objdir.h.gcov test.h.gcov + +# Specifying an object file that could be ambiguous with a directory +RUN: llvm-cov -o objdir/test test.c | diff -u test_no_options.output - +RUN: diff -aub test_objdir.cpp.gcov test.cpp.gcov +RUN: diff -aub test_objdir.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 -- cgit v1.2.3