forked from utilityai/llama-cpp-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (52 loc) · 1.64 KB
/
Makefile
File metadata and controls
66 lines (52 loc) · 1.64 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
TEST_DEVICE ?=
DEVICE_FEATURE = $(if $(TEST_DEVICE),--features $(TEST_DEVICE),)
node_modules: package-lock.json
npm ci
touch node_modules
package-lock.json: package.json
npm install --package-lock-only
.PHONY: clean.cmake
clean.cmake:
rm -rf target/llama-cpp-cmake-build
.PHONY: clippy
clippy:
cargo clippy --workspace --all-targets $(DEVICE_FEATURE) -- -D warnings
.PHONY: coverage
coverage: node_modules
cargo llvm-cov clean --workspace
cargo llvm-cov --no-report --no-fail-fast --workspace $(DEVICE_FEATURE)
cargo llvm-cov report --json --output-path target/llvm-cov.json
cargo llvm-cov report --lcov --output-path target/lcov.info
cargo llvm-cov report
npx rust-coverage-check target/llvm-cov.json \
--workspace-root $(CURDIR) \
--gated llama-cpp-bindings=95 \
--gated llama-cpp-log-decoder=100 \
--gated llama-cpp-bindings-types=100 \
--gated llama-cpp-test-harness=99 \
--gated llama-cpp-test-harness-macros=100
.PHONY: coverage-clean
coverage-clean:
cargo llvm-cov clean --workspace
rm -rf target/llvm-cov-target
rm -f target/llvm-cov.json target/lcov.info
.PHONY: coverage-report
coverage-report:
cargo llvm-cov report --html
.PHONY: fmt
fmt:
cargo fmt --all
.PHONY: fmt.check
fmt.check:
cargo fmt --all --check
.PHONY: test
test: test.unit test.llms
.PHONY: test.harness
test.harness: clippy
cargo test -p llama-cpp-test-harness-macros -p llama-cpp-test-harness $(DEVICE_FEATURE)
.PHONY: test.llms
test.llms: clippy test.harness test.unit
cargo test --no-fail-fast -p llama-cpp-bindings-tests $(DEVICE_FEATURE)
.PHONY: test.unit
test.unit: clippy
cargo test -p llama-cpp-log-decoder -p llama-cpp-bindings $(DEVICE_FEATURE)