Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (50 loc) · 1.78 KB
/
Copy pathMakefile
File metadata and controls
61 lines (50 loc) · 1.78 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
.PHONY: test test-race check build vet clean test-sqlite setup
# Setup development workspace
setup:
@echo "Initializing project..."
go work init . ./adapter/sqlite ./examples
@echo "Project initialized."
# Default test run (uses map-based MemoryStorage, no CGO required)
# Override ARGS to target a specific package or test, e.g.:
# make test ARGS="./adapter"
# make test ARGS="-run TestDeriver"
test:
go test -v $(or $(ARGS),./...)
cd adapter/sqlite && CGO_ENABLED=1 go test -v -tags=sqlite_fts5 $(or $(ARGS),./...)
# Run SQLite adapter tests (requires CGO)
# Override ARGS to target a specific test, e.g.:
# make test-sqlite ARGS="-run TestSQLiteStorage"
test-sqlite:
cd adapter/sqlite && CGO_ENABLED=1 go test -v -tags=sqlite_fts5 $(or $(ARGS),./...)
# Run with race detection
test-race:
go test -v -race $(or $(ARGS),./...)
cd adapter/sqlite && CGO_ENABLED=1 go test -v -race -tags=sqlite_fts5 $(or $(ARGS),./...)
# Build all packages
build:
go build ./...
cd adapter/sqlite && CGO_ENABLED=1 go build -tags=sqlite_fts5 ./...
# Run go vet
vet:
go vet ./...
cd adapter/sqlite && CGO_ENABLED=1 go vet -tags=sqlite_fts5 ./...
# Run go fmt
fmt:
go fmt ./...
cd adapter/sqlite && go fmt ./...
# Check for common issues
check: vet test test-sqlite
@echo "All checks passed"
# Run integration tests (placeholder for future integration tests)
integration-test:
CGO_ENABLED=1 go test -v -tags=\"sqlite_fts5 integration\" ./...
# Coverage report (root + sqlite adapter)
coverage:
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
cd adapter/sqlite && CGO_ENABLED=1 go test -coverprofile=coverage.out -tags=sqlite_fts5 ./...
cd adapter/sqlite && go tool cover -func=coverage.out
# Clean build artifacts
clean:
rm -f coverage.out
rm -f adapter/sqlite/coverage.out