-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJustfile
67 lines (56 loc) · 2.06 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
project := "serde_sjson"
default := "run"
build *ARGS:
cargo build {{ARGS}}
cargo readme > README.md
run *ARGS:
cargo run -- {{ARGS}}
test *ARGS:
cargo test {{ARGS}}
doc:
cargo doc --no-deps
cargo readme > README.md
serve-doc port='8000': doc
python3 -m http.server {{port}} --directory target/doc
release version execute='':
cargo release --sign --allow-branch master {{ if execute != "" { '-x' } else { '' } }} {{version}}
coverage *ARGS:
RUSTFLAGS="-C instrument-coverage" cargo test --tests {{ARGS}} || true
cargo profdata -- merge -sparse default*.profraw -o {{project}}.profdata
rm default*.profraw
cov-report *ARGS:
#!/bin/bash
RUSTFLAGS="-C instrument-coverage" cargo test --tests {{ARGS}} || true
cargo profdata -- merge -sparse default*.profraw -o {{project}}.profdata
rm default*.profraw
cargo cov -- report \
$(for file in \
$(RUSTFLAGS="-C instrument-coverage" 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 \
) \
--use-color --ignore-filename-regex='/.cargo/registry' \
--instr-profile={{project}}.profdata --summary-only
cov-show *ARGS:
#!/bin/bash
RUSTFLAGS="-C instrument-coverage" cargo test --tests {{ARGS}} || true
cargo profdata -- merge -sparse default*.profraw -o {{project}}.profdata
rm default*.profraw
cargo cov -- show \
$(for file in \
$(RUSTFLAGS="-C instrument-coverage" 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 \
) \
--use-color --ignore-filename-regex='/.cargo/registry' \
--instr-profile={{project}}.profdata \
--show-instantiations --show-line-counts-or-regions \
--Xdemangler=rustfilt | bat