-
Notifications
You must be signed in to change notification settings - Fork 98
/
Makefile.internal.toml
69 lines (61 loc) · 1.97 KB
/
Makefile.internal.toml
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
68
69
[tasks.clean]
command = "cargo"
args = ["clean"]
workspace = false
[tasks.install-grcov]
command = "cargo"
args = ["install", "grcov"]
workspace = false
[tasks.install-llvm]
command = "rustup"
args = ["component", "add", "llvm-tools-preview"]
workspace = false
# This actually runs the tests and generates the .profraw file.
[tasks.coverage-run-tests]
workspace = false
command = "cargo"
args = ["test", "--all-features"]
# toolchain = "nightly"
[tasks.coverage-run-tests.env]
RUSTFLAGS = "-Cinstrument-coverage"
RUSTDOCFLAGS = "-Cinstrument-coverage"
LLVM_PROFILE_FILE = "llvm_profile-%p-%m.profraw"
# After generating the .profraw, this step creates the html report.
# Important! Keep in grcov flags in sync with Makefile.internal.toml.
[tasks.coverage-run-grcov]
workspace = false
command = "grcov"
args = [
".",
"--binary-path", "target/debug/deps/",
"--source-dir", ".",
"--branch", # Enables parsing branch coverage information
"--ignore-not-existing",
"--ignore", "fluent-testing/*", # Test-only fixtures.
"--ignore", "fluent-syntax/src/bin/*", # Small binary utility that doesn't require testing.
"--output-type", "html",
"--output-path", "coverage",
"--excl-start", "^#\\[cfg\\(test\\)\\]|^// coverage\\(off\\)",
"--excl-br-start", "^#\\[cfg\\(test\\)\\]|^// coverage\\(off\\)",
"--excl-stop", "^// coverage\\(on\\)",
"--excl-br-stop", "^// coverage\\(on\\)",
"--excl-line", "\\#\\[derive\\(|// cov\\(skip\\)",
"--excl-br-line", "\\#\\[derive\\(|// cov\\(skip\\)",
]
[tasks.coverage-run-grcov.env]
LLVM_PROFILE_FILE = "llvm_profile-%p-%m.profraw"
# Cleans up all of the .profraw files left over after running -C instrument-coverage
[tasks.coverage-clean-profraw]
workspace = false
command = "find"
args = [
".",
"-name", "*.profraw",
"-maxdepth", "2",
"-delete"
]
# Notify the user the report is ready.
[tasks.coverage-notify-completed]
workspace = false
command = "echo"
args = ["\nThe coverage report is ready:\n./coverage\n"]