Makefile 874 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .PHONY: build test test-v test-cover bench clean fmt lint
  2. # Build the project
  3. build:
  4. go build -o pizzasql ./main.go
  5. # Run all tests
  6. test:
  7. go test ./...
  8. # Run tests with verbose output
  9. test-v:
  10. go test -v ./...
  11. # Run tests with coverage
  12. test-cover:
  13. go test -coverprofile=coverage.out ./...
  14. go tool cover -html=coverage.out -o coverage.html
  15. @echo "Coverage report: coverage.html"
  16. # Run benchmarks
  17. bench:
  18. go test -bench=. -benchmem ./...
  19. # Run lexer tests only
  20. test-lexer:
  21. go test -v ./pkg/lexer/...
  22. # Run parser tests only
  23. test-parser:
  24. go test -v ./pkg/parser/...
  25. # Format code
  26. fmt:
  27. go fmt ./...
  28. # Run linter (requires golangci-lint)
  29. lint:
  30. golangci-lint run
  31. # Clean build artifacts
  32. clean:
  33. rm -f pizzasql coverage.out coverage.html
  34. # Run tests with race detection
  35. test-race:
  36. go test -race ./...
  37. # Quick test for development
  38. quick:
  39. go test -short ./...