mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +00:00
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.
This commit is contained in:
committed by
Ron Evans
parent
2d5a8d407b
commit
f18c6e342f
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user