• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Test -r (--relative-only) and -s (--source-prefix).
2# UNSUPPORTED: system-windows
3RUN: rm -rf %t && mkdir %t && cd %t
4RUN: cp %S/Inputs/abs-path.gcno %S/Inputs/abs-path.gcda .
5
6RUN: llvm-cov gcov abs-path.gcda | FileCheck %s
7RUN: rm abs-path.c.gcov a.h.gcov
8CHECK: File '/tmp/c/abs-path.c'
9CHECK: File '/tmp/h/a.h'
10
11# If there is no source file with a relative path, nothing is dumped.
12RUN: llvm-cov gcov -r abs-path.gcda 2>&1 | count 0
13RUN: llvm-cov gcov -r -s /t abs-path.gcda 2>&1 | count 0
14RUN: not ls abs-path.c.gcov 2> /dev/null
15
16# -s strips a prefix from filenames and can change filtering of -r.
17RUN: llvm-cov gcov -r -s /tmp abs-path.gcda | FileCheck %s --check-prefix=STRIP1 --match-full-lines --strict-whitespace
18RUN: FileCheck %s --check-prefix=STRIP1_C < abs-path.c.gcov
19RUN: FileCheck %s --check-prefix=STRIP1_H < a.h.gcov
20
21# Test full option names.
22RUN: llvm-cov gcov --relative-only --source-prefix=/tmp abs-path.gcda | FileCheck %s --check-prefix=STRIP1 --match-full-lines --strict-whitespace
23
24      STRIP1:File 'c/abs-path.c'
25 STRIP1-NEXT:Lines executed:100.00% of 1
26 STRIP1-NEXT:Creating 'abs-path.c.gcov'
27STRIP1-EMPTY:
28 STRIP1-NEXT:File 'h/a.h'
29 STRIP1-NEXT:Lines executed:0.00% of 1
30 STRIP1-NEXT:Creating 'a.h.gcov'
31
32STRIP1_C: 0:Source:c/abs-path.c
33STRIP1_H: 0:Source:h/a.h
34
35RUN: llvm-cov gcov -r -s /tmp/h abs-path.gcda | FileCheck %s --check-prefix=STRIP2
36
37STRIP2-NOT: File
38STRIP2:     File 'a.h'
39