-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
138 lines (108 loc) · 2.94 KB
/
Makefile
File metadata and controls
138 lines (108 loc) · 2.94 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.PHONY: test check clean build dist all
.PHONY: clean
clean:
@cargo clean
.PHONY: clean.out.tarpaulin
clean.out.tarpaulin:
-@$(RM) -f cobertura.xml
-@$(RM) -f tarpaulin-report.json
-@$(RM) -f tarpaulin-report.html
-@$(RM) -f lcov.info
.PHONY: depCheck
depCheck:
@cargo check --all --bins --examples --tests
.PHONY: dep
dep: depCheck
.PHONY: dep.lint.fmt
dep.lint.fmt:
cargo fmt --all -- --check
.PHONY: dep.lint.fmt.emit.all.files
dep.lint.fmt.emit.all.files:
cargo fmt --all -- --emit files
$(info can change to: cargo fmt -- --emit files|stdout)
.PHONY: dep.lint.check.package.mistakes
dep.lint.check.package.mistakes:
cargo clippy -- -D warnings
.PHONY: style
style: dep.lint.fmt dep.lint.check.package.mistakes
.PHONY: run
run:
cargo run
.PHONY: doc
doc:
@cargo doc --no-deps
.PHONY: docOpen
docOpen:
@cargo doc -q --no-deps --open
.PHONY: testList
testList: testBuild
@cargo test -q -- --list
.PHONY: testBuild
testBuild:
@cargo test -q --no-run
.PHONY: testAll
testAll: testBuild
$(info -> can use as: cargo test --test <foo>)
@cargo test --tests -- --show-output
.PHONY: testIgnore
testIgnore: testBuild
$(info -> run with test method as: #[ignore])
@cargo test -- --ignored --show-output
.PHONY: testLib
testLib:
@cargo test --lib -- --show-output
.PHONY: testBenches
testBenches:
$(info -> can use as: cargo test --benche <foo>)
@cargo test --benches -- --show-output
.PHONY: testBins
testBins:
$(info -> can use as: cargo test --bin <foo>)
@cargo test --bins -- --show-output
.PHONY: testExamples
testExamples:
$(info -> can use as: cargo test --example <foo>)
@cargo test --examples -- --show-output
.PHONY: testDoc
testDoc:
@cargo test --doc -- --show-output
.PHONY: bench
bench:
@cargo bench -q
.PHONY: benchBenches
benchBenches:
@cargo bench -q --benches
.PHONY: benchLib
benchLib:
@cargo bench -q --lib
.PHONY: ci
ci: style testAll
.PHONY: test.coverage.html
test.coverage.html:
$(info use: https://github.com/xd009642/tarpaulin)
$(info if run error install as: cargo install cargo-tarpaulin)
cargo tarpaulin --all-features --out Html
.PHONY: test.coverage.stdout
test.coverage.stdout:
$(info use: https://github.com/xd009642/tarpaulin)
$(info if run error install as: cargo install cargo-tarpaulin)
cargo tarpaulin --all-features --out Stdout
.PHONY: ci.coverage
ci.coverage: ci test.coverage.stdout
.PHONY: all
all: dep ci ci.coverage clean
.PHONY: helpProjectRoot
helpProjectRoot:
@echo "Help: Project root Makefile"
@echo "~> make init - check base env of this project"
@echo "~> make dep - check and install"
@echo "~> make clean - remove build binary file, log files, and testdata"
@echo ""
@echo "~> make testAll - run test fast"
@echo "~> make ci - run CI tasks"
@echo "~> make ci.coverage - run CI coverage"
@echo ""
@echo "~> make all - run commonly used"
@echo ""
.PHONY: help
help: helpProjectRoot