mirror of
https://github.com/unclebob/crapper.git
synced 2026-11-26 18:18:49 +00:00
Export llvm-cov against the Swift test executable.
The first sorted `*PackageTests` file is the Mach-O inside a .dSYM, and the Linux executable is named `*PackageTests.xctest`, so llvm-cov was pointed at debug info or at nothing. Paths under a `.dSYM` bundle are skipped, and the `.xctest` file is accepted. One test expects the Contents/MacOS executable when a dSYM is beside it; the other expects the Linux file. Co-authored-by: Robert C. Martin <[email protected]>
This commit is contained in:
co-authored by
Robert C. Martin
parent
95c17c42ab
commit
ccbac08c2b
@@ -104,7 +104,7 @@ Swift package:
|
||||
swift test --enable-code-coverage
|
||||
bin="$(dirname "$(command -v swift)")/llvm-cov"
|
||||
profdata="$(find .build -path '*/codecov/default.profdata' -print -quit)"
|
||||
binary="$(find .build -type f -name '*PackageTests' -print -quit)"
|
||||
binary="$(find .build -type f \( -name '*PackageTests' -o -name '*PackageTests.xctest' \) ! -path '*.dSYM/*' -print -quit)"
|
||||
mkdir -p target/coverage/swift
|
||||
"$bin" export -format=json -instr-profile="$profdata" "$binary" \
|
||||
> target/coverage/swift/llvm-cov.json
|
||||
|
||||
Reference in New Issue
Block a user