aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-03-13 14:37:16 +0100
committerAyke van Laethem <[email protected]>2024-03-13 14:37:16 +0100
commite3afeadc26c427c1273c5d46bab7439d938517cd (patch)
treeada41cdf72e84a203b460c4faa9880ad755e0d02
parent6384ecace093df2d0b93915886954abfc4ecfe01 (diff)
downloadtinygo-e3afeadc26c427c1273c5d46bab7439d938517cd.tar.gz
tinygo-e3afeadc26c427c1273c5d46bab7439d938517cd.zip
Makefile: allow overriding the packages to test in `make test`makefile-test-pkgs
This way you can for example run `make test GOTESTPKGS=./builder` to only test the builder package. I've often done this by manually modifying the Makefile, so having a make parameter available would make this much easier.
-rw-r--r--GNUmakefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/GNUmakefile b/GNUmakefile
index cc3367060..f3495b49d 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -31,6 +31,7 @@ export GOROOT = $(shell $(GO) env GOROOT)
# Flags to pass to go test.
GOTESTFLAGS ?=
+GOTESTPKGS ?= ./builder ./cgo ./compileopts ./compiler ./interp ./transform .
# tinygo binary for tests
TINYGO ?= $(call detect,tinygo,tinygo $(CURDIR)/build/tinygo)
@@ -283,7 +284,7 @@ tinygo:
@if [ ! -f "$(LLVM_BUILDDIR)/bin/llvm-config" ]; then echo "Fetch and build LLVM first by running:"; echo " $(MAKE) llvm-source"; echo " $(MAKE) $(LLVM_BUILDDIR)"; exit 1; fi
CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOENVFLAGS) $(GO) build -buildmode exe -o build/tinygo$(EXE) -tags "byollvm osusergo" -ldflags="-X github.com/tinygo-org/tinygo/goenv.GitSha1=`git rev-parse --short HEAD`" .
test: wasi-libc check-nodejs-version
- CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) test $(GOTESTFLAGS) -timeout=20m -buildmode exe -tags "byollvm osusergo" ./builder ./cgo ./compileopts ./compiler ./interp ./transform .
+ CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) test $(GOTESTFLAGS) -timeout=20m -buildmode exe -tags "byollvm osusergo" $(GOTESTPKGS)
# Standard library packages that pass tests on darwin, linux, wasi, and windows, but take over a minute in wasi
TEST_PACKAGES_SLOW = \