-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
72 lines (59 loc) · 1.84 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Project Paths
PROJECT_ROOT := $(shell pwd)
TMP_PATH := $(PROJECT_ROOT)/tmp
GNO_PATH := $(TMP_PATH)/gno
GNOSWAP_PATH := $(TMP_PATH)/gnoswap
SCRIPT := $(PROJECT_ROOT)/scripts/test.sh
include $(PROJECT_ROOT)/scripts/test_values.mk
# Default Target
.PHONY: all
all: help
# 📌 Run the entire test if executed without a specific folder
.PHONY: test
test: reset
@DEBUG=$(DEBUG) bash $(SCRIPT) test
# 📌 Run tests on specific folders only
.PHONY: test-folder
test-folder:
@if [ -z "$(FOLDER)" ]; then \
echo "❌ Error: Please specify a folder using 'make test-folder FOLDER=<path>'"; \
exit 1; \
else \
DEBUG=$(DEBUG) bash $(SCRIPT) test-folder $(FOLDER); \
fi
# 📌 Reset the test environment
.PHONY: reset
reset: clean clone setup
# 📌 Initial setup (Go, Python installation & GnoVM setup)
.PHONY: setup
setup:
@DEBUG=$(DEBUG) bash $(SCRIPT) setup $(GNOSWAP_PATH)
# 📌 Project Clone (GnoVM & Gnoswap)
.PHONY: clone
clone:
@DEBUG=$(DEBUG) bash $(SCRIPT) clone
# 📌 Delete the temporary folder
.PHONY: clean
clean:
@rm -rf $(TMP_PATH)
# 📌 find test files
.PHONY: search
search:
@DEBUG=$(DEBUG) bash $(SCRIPT) search $(FOLDER) $(EXTENSION)
.PHONY: fmt
fmt:
find . -name "*.gno" -type f -exec gofumpt -w {} \;
# 📌 Help message
.PHONY: help
help:
@echo "🔹 Available commands:"
@echo ""
@echo " make test Run tests for all folders"
@echo " make test-folder FOLDER=<path> Run test for a specific folder"
@echo " make setup Install dependencies (Go, Python, etc.)"
@echo " make clone Clone GnoVM and Gnoswap repositories"
@echo " make help Show this help message"
@echo " make clean Delete the temporary folder"
@echo " make search Find test files"
@echo " make reset Reset the test environment"
@echo " make fmt Format all .gno files"