-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJustfile
35 lines (30 loc) · 886 Bytes
/
Justfile
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
27
28
29
30
31
32
33
34
35
cp:
cp ../llvm-project/test.o test.o
objdump filename: cp
cargo run --bin objdump -- {{filename}}
ld: cp
cargo run --bin linker -- test.o
run: ld
cargo run --bin loader -- test
# Create code coverage. You should `cargo install rustfilt, cargo-binutils` and `rustup component add llvm-tools`
coverage:
#!/bin/bash
export LLVM_PROFILE_FILE="target/%p-%m.profraw"
export RUSTFLAGS="-C instrument-coverage"
cargo build
cargo test -q
cargo profdata -- merge -sparse target/*.profraw -o target/coverage.profdata
cargo cov -- export \
$( \
for file in \
$( \
cargo test --tests --no-run --message-format=json \
| jq -r "select(.profile.test == true) | .filenames[]" \
| grep -v dSYM - \
); \
do \
printf "%s %s " -object $file; \
done \
) \
--instr-profile=target/coverage.profdata --format lcov > target/lcov.info
rm target/*.profraw