File: make-lcov-info.bash

package info (click to toggle)
rust-sudo-rs 0.2.5-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,768 kB
  • sloc: sh: 160; makefile: 31; ansic: 1
file content (26 lines) | stat: -rwxr-xr-x 705 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash

set -euo pipefail

rustup component add llvm-tools

llvm_profdata=$(find "$(rustc --print sysroot)" -name llvm-profdata)
profdata="$SUDO_TEST_PROFRAW_DIR"/sudo-rs.profdata
$llvm_profdata merge \
	-sparse \
	"$SUDO_TEST_PROFRAW_DIR"/**/*.profraw \
	-o "$profdata"

binary="$SUDO_TEST_PROFRAW_DIR"/sudo-rs
dockerid=$(docker create sudo-test-rs)
docker cp "$dockerid":/usr/bin/sudo "$binary"
docker rm "$dockerid"

llvm_cov="$(dirname "$llvm_profdata")"/llvm-cov
$llvm_cov export \
	-format=lcov \
	--ignore-filename-regex='/usr/local/cargo/registry' \
	--ignore-filename-regex='/rustc' \
	--instr-profile="$profdata" \
	--object "$binary" \
	-path-equivalence=/usr/src/sudo,"$(pwd)" >lcov.info