-
-
Notifications
You must be signed in to change notification settings - Fork 101
/
Makefile
101 lines (85 loc) · 3.07 KB
/
Makefile
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
DOC_FEATURES=loader,json,urlencode,custom_syntax,fuel
TEST_FEATURES=unstable_machinery,builtins,loader,json,urlencode,debug,internal_debug,macros,multi_template,adjacent_loop_items,custom_syntax,deserialization,serde,loop_controls
.PHONY: all
all: test
.PHONY: build
build:
@cargo build --all
.PHONY: doc
doc:
@cd minijinja; RUSTC_BOOTSTRAP=1 RUSTDOCFLAGS="--cfg=docsrs --html-in-header doc-header.html" cargo doc -p minijinja -p minijinja-autoreload -p minijinja-contrib --no-deps --features=$(DOC_FEATURES)
.PHONY: test-msrv
test-msrv:
@$(MAKE) run-tests FEATURES=$(TEST_FEATURES)
@$(MAKE) run-tests FEATURES=$(TEST_FEATURES),preserve_order,key_interning,unicode
@echo "CARGO TEST ALL FEATURES"
@cd minijinja; cargo test --all-features
.PHONY: test
test: test-msrv test-cli
@echo "CARGO TEST MINIJINJA-CONTRIB ALL FEATURES"
@cd minijinja-contrib; cargo test --all-features
.PHONY: wasi-test
wasi-test:
@cd minijinja; cargo test --all-features --target=wasm32-wasi -- --nocapture
.PHONY: python-test
python-test:
@make -C minijinja-py
.PHONY: python-type-check
python-type-check:
@make -C minijinja-py type-check
.PHONY: snapshot-tests
snapshot-tests:
@cd minijinja; cargo insta test --all-features --review
.PHONY: run-tests
run-tests:
@rustup component add rustfmt 2> /dev/null
@echo "CARGO TESTS"
@cd minijinja; cargo test --features=json,urlencode,internal_debug,loop_controls
@echo "CARGO TEST SPEEDUPS"
@cd minijinja; cargo test --no-default-features --features=speedups,$(TEST_FEATURES)
@echo "CARGO CHECK NO_DEFAULT_FEATURES"
@cd minijinja; cargo check --no-default-features --features=debug
@cd minijinja-autoreload; cargo test
@cd minijinja-contrib; cargo test
.PHONY: test-cli
test-cli:
@cd minijinja-cli; cargo test
.PHONY: check
check:
@echo "check no default features:"
@cd minijinja; cargo check --no-default-features
@echo "check all features:"
@cd minijinja; cargo check --all-features
@echo "check custom-delimiters:"
@cd minijinja; cargo check --features=custom_syntax
@echo "check custom-delimiters+loader:"
@cd minijinja; cargo check --features=custom_syntax,loader
@echo "check loader:"
@cd minijinja; cargo check --features=loader
@echo "check macro only:"
@cd minijinja; cargo check --no-default-features --features macros
@echo "check multi_template only:"
@cd minijinja; cargo check --no-default-features --features multi_template
@echo "check minijinja-autoreload:"
@cd minijinja-autoreload; cargo check
@cd minijinja-autoreload; cargo check --no-default-features
@echo "check minijinja-contrib:"
@cd minijinja-contrib; cargo check
@cd minijinja-contrib; cargo check --all-features
@cd minijinja-contrib; cargo check --no-default-features
.PHONY:
check-cli:
@cd minijinja-cli; cargo check --no-default-features
@cd minijinja-cli; cargo check
.PHONY: format
format:
@rustup component add rustfmt 2> /dev/null
@cargo fmt --all
.PHONY: format-check
format-check:
@rustup component add rustfmt 2> /dev/null
@cargo fmt --all -- --check
.PHONY: lint
lint:
@rustup component add clippy 2> /dev/null
@cargo clippy --all -- -F clippy::dbg-macro -D warnings