aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-06-27 19:31:35 +0200
committerRon Evans <[email protected]>2024-06-28 12:31:38 +0200
commitf18c6e342f834988caf43fd652b2baae9c3093f0 (patch)
tree5c72fc37c579b0d2be48edffac810d91428239b8
parent2d5a8d407bacad4f5c5c67378e83e38df271199f (diff)
downloadtinygo-f18c6e342f834988caf43fd652b2baae9c3093f0.tar.gz
tinygo-f18c6e342f834988caf43fd652b2baae9c3093f0.zip
test: support GOOS/GOARCH pairs in the -target flag
This means it's possible to test just a particular OS/arch with a command like this: go test -run=Build -target=linux/arm I found it useful while working on MIPS support.
-rw-r--r--main_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/main_test.go b/main_test.go
index 0f0d52f4d..1ea16cd14 100644
--- a/main_test.go
+++ b/main_test.go
@@ -297,6 +297,10 @@ func emuCheck(t *testing.T, options compileopts.Options) {
}
func optionsFromTarget(target string, sema chan struct{}) compileopts.Options {
+ separators := strings.Count(target, "/")
+ if (separators == 1 || separators == 2) && !strings.HasSuffix(target, ".json") {
+ return optionsFromOSARCH(target, sema)
+ }
return compileopts.Options{
// GOOS/GOARCH are only used if target == ""
GOOS: goenv.Get("GOOS"),