mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously the path to covered files in the __LLVM_COV / __llvm_covmap section were absolute. This made remote builds with coverage information difficult because all machines would have to have the same build root. This change uses the values for `-coverage-prefix-map` to remap files in the coverage info to relative paths. These paths work correctly with llvm-cov when it is run from the same source directory as the compilation, or from a different directory using the `-path-equivalence` argument. This is analogous to this change in clang https://reviews.llvm.org/D81122
10 lines
660 B
Swift
10 lines
660 B
Swift
// RUN: not %target-swiftc_driver -coverage-prefix-map old %s 2>&1 | %FileCheck %s -check-prefix CHECK-INVALID
|
|
// RUN: %target-swiftc_driver -### -coverage-prefix-map old=new %s 2>&1 | %FileCheck %s -check-prefix CHECK-SIMPLE
|
|
// RUN: %target-swiftc_driver -### -coverage-prefix-map old=n=ew %s 2>&1 | %FileCheck %s -check-prefix CHECK-COMPLEX
|
|
// RUN: %target-swiftc_driver -### -coverage-prefix-map old= %s 2>&1 | %FileCheck %s -check-prefix CHECK-EMPTY
|
|
|
|
// CHECK-INVALID: error: invalid argument 'old' to -coverage-prefix-map
|
|
// CHECK-SIMPLE: coverage-prefix-map old=new
|
|
// CHECK-COMPLEX: coverage-prefix-map old=n=ew
|
|
// CHECK-EMPTY: coverage-prefix-map old=
|