From 741aefb2d307e95cd2c756620e5d886a06b7c4de Mon Sep 17 00:00:00 2001 From: Biswa Kalyan Bhuyan Date: Fri, 25 Apr 2025 14:58:40 +0530 Subject: finance/backend: feat: wrote unit/integration tests for core API endpoints --- backend/Makefile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 backend/Makefile (limited to 'backend/Makefile') diff --git a/backend/Makefile b/backend/Makefile new file mode 100644 index 0000000..0506ee3 --- /dev/null +++ b/backend/Makefile @@ -0,0 +1,47 @@ +# Makefile for the finance backend application + +# Variables +BINARY_NAME=finance-backend +GO=go +GOTEST=$(GO) test +GOVET=$(GO) vet +GOBUILD=$(GO) build + +.PHONY: all build clean test vet run lint + +# Default target +all: test build + +# Build the application +build: + $(GOBUILD) -o $(BINARY_NAME) ./cmd/api/main.go + +# Clean build files +clean: + rm -f $(BINARY_NAME) + +# Run the application +run: build + ./$(BINARY_NAME) + +# Run all tests with verbose output +test: + $(GOTEST) -v ./... + +# Test only the handlers +test-handlers: + $(GOTEST) -v ./handlers/... + +# Run code vetting +vet: + $(GOVET) ./... + +# Run linting (requires golint) +lint: + @command -v golint >/dev/null 2>&1 || { echo >&2 "golint not installed. Installing..."; $(GO) install golang.org/x/lint/golint@latest; } + golint ./... + +# Run tests with coverage report +test-coverage: + $(GOTEST) -coverprofile=coverage.out ./... + $(GO) tool cover -html=coverage.out \ No newline at end of file -- cgit v1.2.3-59-g8ed1b