forked from bytecodealliance/go-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (32 loc) · 1011 Bytes
/
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
wit_files = $(sort $(shell find testdata -name '*.wit' ! -name '*.golden.*'))
# json recompiles the JSON intermediate representation test files.
.PHONY: json
json: $(wit_files)
.PHONY: $(wit_files)
$(wit_files):
wasm-tools component wit -j --all-features $@ > [email protected]
# golden recompiles the .golden.wit test files.
.PHONY: golden
golden: json
go test ./wit -update
# generated generated writes test Go code to the filesystem
.PHONY: generated
generated: clean json
go test ./wit/bindgen -write
.PHONY: clean
clean:
rm -rf ./generated/*
# tests/generated writes generated Go code to the tests directory
.PHONY: tests/generated
tests/generated: json
go generate ./tests
# test runs Go and TinyGo tests
GOTESTARGS :=
.PHONY: test
test:
go test $(GOTESTARGS) ./...
GOARCH=wasm GOOS=wasip1 go test $(GOTESTARGS) ./...
tinygo test $(GOTESTARGS) ./...
tinygo test -target=wasip1 $(GOTESTARGS) ./...
tinygo test -target=wasip2 $(GOTESTARGS) ./...
tinygo test -target=wasip2 $(GOTESTARGS) ./tests/...