From bde73fc214f996b3ecae318972f2e2263e5ddb25 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 4 May 2020 22:44:24 +0200 Subject: [PATCH] main: fix test subcommand It was broken for quite some time without anybody noticing... --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 9fe0b240..64f7036c 100644 --- a/main.go +++ b/main.go @@ -124,6 +124,7 @@ func Build(pkgName, outpath string, options *compileopts.Options) error { // Test runs the tests in the given package. func Test(pkgName string, options *compileopts.Options) error { + options.TestConfig.CompileTestBinary = true config, err := builder.NewConfig(options) if err != nil { return err @@ -135,7 +136,6 @@ func Test(pkgName string, options *compileopts.Options) error { // For details: https://github.com/golang/go/issues/21360 config.Target.BuildTags = append(config.Target.BuildTags, "test") - options.TestConfig.CompileTestBinary = true return builder.Build(pkgName, ".elf", config, func(tmppath string) error { cmd := exec.Command(tmppath) cmd.Stdout = os.Stdout