aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Makefile
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswa Kalyan Bhuyan <biswa@surgot.in> 2025-04-25 14:58:40 +0530
committerLibravatarLibravatar Biswa Kalyan Bhuyan <biswa@surgot.in> 2025-04-25 14:58:40 +0530
commit741aefb2d307e95cd2c756620e5d886a06b7c4de (patch)
tree6246316c15d1c8a71ae10c81557bb9ffbe813522 /backend/Makefile
parent7b9fe4639cafbcc35c860e23a20a2c0d2e29283d (diff)
downloadfinance-741aefb2d307e95cd2c756620e5d886a06b7c4de.tar.gz
finance-741aefb2d307e95cd2c756620e5d886a06b7c4de.tar.bz2
finance-741aefb2d307e95cd2c756620e5d886a06b7c4de.zip
finance/backend: feat: wrote unit/integration tests for core API endpoints
Diffstat (limited to 'backend/Makefile')
-rw-r--r--backend/Makefile47
1 files changed, 47 insertions, 0 deletions
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