39 lines · plain
1# Test -r (--relative-only) and -s (--source-prefix).2# UNSUPPORTED: system-windows3RUN: rm -rf %t && mkdir %t && cd %t4RUN: cp %S/Inputs/abs-path.gcno %S/Inputs/abs-path.gcda .5 6RUN: llvm-cov gcov abs-path.gcda | FileCheck %s7RUN: rm abs-path.c.gcov a.h.gcov8CHECK: 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 013RUN: llvm-cov gcov -r -s /t abs-path.gcda 2>&1 | count 014RUN: not ls abs-path.c.gcov 2> /dev/null15 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-whitespace18RUN: FileCheck %s --check-prefix=STRIP1_C < abs-path.c.gcov19RUN: FileCheck %s --check-prefix=STRIP1_H < a.h.gcov20 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-whitespace23 24 STRIP1:File 'c/abs-path.c'25 STRIP1-NEXT:Lines executed:100.00% of 126 STRIP1-NEXT:Creating 'abs-path.c.gcov'27STRIP1-EMPTY:28 STRIP1-NEXT:File 'h/a.h'29 STRIP1-NEXT:Lines executed:0.00% of 130 STRIP1-NEXT:Creating 'a.h.gcov'31 32STRIP1_C: 0:Source:c/abs-path.c33STRIP1_H: 0:Source:h/a.h34 35RUN: llvm-cov gcov -r -s /tmp/h abs-path.gcda | FileCheck %s --check-prefix=STRIP236 37STRIP2-NOT: File38STRIP2: File 'a.h'39