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