Makefile 974 B

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