-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (62 loc) · 3.58 KB
/
Copy pathMakefile
File metadata and controls
83 lines (62 loc) · 3.58 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
# ──────────────────────────────────────────────────────────────────────────────
# Fennec — Intelligent Image Compression Library v1.0.3
# ──────────────────────────────────────────────────────────────────────────────
.PHONY: all build test test-unit test-integration test-race test-cover \
bench lint vet fmt fixtures clean help install
# Default target
all: fmt vet test build
# ─── Build ────────────────────────────────────────────────────────────────────
build:
go build -o bin/fennec ./cmd/fennec
install:
go install ./cmd/fennec
# ─── Testing ──────────────────────────────────────────────────────────────────
fixtures:
go test -run TestGenerateTestData -v
test: fixtures
go test -count=1 -race -v ./...
test-unit:
go test -count=1 -race -v -run "^Test[^I]" ./...
test-integration: fixtures
go test -count=1 -race -v -run "^TestIntegration" ./...
test-race: fixtures
go test -count=1 -race -v ./...
test-cover: fixtures
go test -count=1 -race -coverprofile=coverage.out -covermode=atomic ./...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report: coverage.html"
bench: fixtures
go test -bench=. -benchmem -run=^$$ ./...
# ─── Code Quality ─────────────────────────────────────────────────────────────
fmt:
gofmt -s -w .
vet:
go vet ./...
lint:
@command -v staticcheck >/dev/null 2>&1 || { echo "Install: go install honnef.co/go/tools/cmd/staticcheck@latest"; exit 1; }
staticcheck ./...
# ─── Cleanup ──────────────────────────────────────────────────────────────────
clean:
rm -rf bin/ coverage.out coverage.html
rm -rf testdata/
# ─── Help ─────────────────────────────────────────────────────────────────────
help:
@echo "Fennec v1.0.3— Development Commands"
@echo ""
@echo " make Run fmt + vet + test + build (default)"
@echo " make build Build the CLI → bin/fennec"
@echo " make install Install CLI to \$$GOPATH/bin"
@echo ""
@echo " make test Run ALL tests (generates fixtures first)"
@echo " make test-unit Run unit tests only (fast, no I/O)"
@echo " make test-integration Run integration tests (with fixtures)"
@echo " make test-race Run all tests with race detector"
@echo " make test-cover Run tests + generate HTML coverage report"
@echo " make bench Run benchmarks"
@echo ""
@echo " make fmt Format code with gofmt"
@echo " make vet Run go vet"
@echo " make lint Run staticcheck (install separately)"
@echo " make fixtures Generate test images in testdata/"
@echo " make clean Remove build artifacts + testdata"
@echo " make help Show this help"