0

Add tests, add makefile targets - test and help

This commit is contained in:
eleksir
2026-03-30 17:05:16 +03:00
parent 77bddef812
commit 2ef9199c9a
4 changed files with 1044 additions and 0 deletions

View File

@@ -8,6 +8,19 @@ UNIX_BINARY=${MYNAME}
WINDOWS_BINARY=${MYNAME}.exe
RMCMD=rm -rf
# Default target
.PHONY: help
help:
@echo "aleesa-misc-go build system"
@echo ""
@echo "Available targets:"
@echo " all Clean and build (default)"
@echo " build Build binary only"
@echo " clean Remove built artifacts"
@echo " test Run unit tests"
@echo " upgrade Update dependencies (get, tidy, vendor)"
@echo ""
# На windows имя бинарника может зависеть не только от платформы, но и от выбранной цели, для linux-а суффикс .exe
# не нужен
ifeq ($(OS),Windows_NT)
@@ -30,6 +43,7 @@ define IFS
endef
.PHONY: all build clean test upgrade help
all: clean build
@@ -69,6 +83,10 @@ else # not ifeq ($(OS),Windows_NT)
endif
test:
go test ./...
upgrade:
go get -u ./...
go mod tidy