[llvm] 1336c5a - [llvm-cov][test] Add test coverage for "gcov" implying "llvm-cov gcov" compatibility.

Jordan Rupprecht via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 08:25:15 PDT 2021


Author: Jordan Rupprecht
Date: 2021-05-12T08:21:42-07:00
New Revision: 1336c5ae2fea48bcb54a5050a01b59333fd502aa

URL: https://github.com/llvm/llvm-project/commit/1336c5ae2fea48bcb54a5050a01b59333fd502aa
DIFF: https://github.com/llvm/llvm-project/commit/1336c5ae2fea48bcb54a5050a01b59333fd502aa.diff

LOG: [llvm-cov][test] Add test coverage for "gcov" implying "llvm-cov gcov" compatibility.

Much like other LLVM binary utilities, `llvm-cov` has a symlink compatibility feature where it runs in `gcov` compatibility mode if the binary name ends in `gcov`. This is identical to invoking `llvm-cov gcov ...`.

Differential Revision: https://reviews.llvm.org/D102299

Added: 
    llvm/test/tools/llvm-cov/tool-name.test

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-cov/tool-name.test b/llvm/test/tools/llvm-cov/tool-name.test
new file mode 100644
index 0000000000000..302cd1a9be6dd
--- /dev/null
+++ b/llvm/test/tools/llvm-cov/tool-name.test
@@ -0,0 +1,26 @@
+## Don't make symlinks on Windows.
+# UNSUPPORTED: system-windows
+
+# RUN: rm -rf %t
+# RUN: mkdir %t
+
+## By default, assume llvm-cov.
+# RUN: ln -s llvm-cov %t/llvm-foo
+
+# RUN: llvm-cov --help 2>&1 | FileCheck --check-prefix=COV %s
+# RUN: %t/llvm-foo --help 2>&1 | FileCheck --check-prefix=COV %s
+
+# COV: Shows code coverage information.
+# COV: Subcommands:
+
+## If the filename ends in "gcov", assume gcov compatibility.
+# RUN: ln -s llvm-cov %t/llvm-gcov
+# RUN: ln -s llvm-cov %t/gcov
+
+# RUN: %t/llvm-gcov --help 2>&1 | FileCheck --check-prefix=GCOV %s
+# RUN: %t/gcov --help 2>&1 | FileCheck --check-prefix=GCOV %s
+# RUN: llvm-cov gcov --help 2>&1 | FileCheck --check-prefix=GCOV %s
+
+# GCOV: OVERVIEW: LLVM code coverage tool
+# GCOV: --gcda{{.*}}Override inferred gcda file
+# GCOV: --gcno{{.*}}Override inferred gcno file


        


More information about the llvm-commits mailing list