2024-10-24 18:07:10 +00:00
|
|
|
.PHONY: build clean test
|
|
|
|
|
|
|
|
build: clean
|
|
|
|
@echo "======================== Building Binary ======================="
|
2024-10-29 17:36:25 +00:00
|
|
|
minify wfa.js > dist/wfa.js
|
2024-11-07 19:01:01 +00:00
|
|
|
GOOS=js GOARCH=wasm CGO_ENABLED=0 tinygo build -panic=trap -no-debug -opt=2 -target=wasm -o dist/wfa.wasm .
|
2024-10-24 18:07:10 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "======================== Cleaning Project ======================"
|
|
|
|
go clean
|
2024-10-29 17:36:25 +00:00
|
|
|
rm -f dist/wfa.wasm dist/wfa.js cover.prof cpu.prof mem.prof test.test
|
2024-10-24 18:07:10 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
@echo "======================== Running Tests ========================="
|
2024-10-29 17:03:19 +00:00
|
|
|
go test -v -cover -coverpkg=./pkg/ -coverprofile cover.prof -cpuprofile cpu.prof -memprofile mem.prof ./test/
|
2024-10-24 18:07:10 +00:00
|
|
|
@echo "======================= Coverage Report ========================"
|
2024-10-29 17:03:19 +00:00
|
|
|
go tool cover -func=cover.prof
|
|
|
|
@rm -f cover.prof
|
|
|
|
@echo "==================== CPU Performance Report ===================="
|
|
|
|
go tool pprof -top cpu.prof
|
|
|
|
@rm -f cpu.prof
|
|
|
|
@echo "=================== Memory Performance Report =================="
|
|
|
|
go tool pprof -top mem.prof
|
|
|
|
@rm -f mem.prof
|
|
|
|
|
|
|
|
@rm -f test.test
|