mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 16:03:41 +00:00
main: fix test subcommand
It was broken for quite some time without anybody noticing...
This commit is contained in:
committed by
Ron Evans
parent
ab2a81cc52
commit
bde73fc214
@@ -124,6 +124,7 @@ func Build(pkgName, outpath string, options *compileopts.Options) error {
|
|||||||
|
|
||||||
// Test runs the tests in the given package.
|
// Test runs the tests in the given package.
|
||||||
func Test(pkgName string, options *compileopts.Options) error {
|
func Test(pkgName string, options *compileopts.Options) error {
|
||||||
|
options.TestConfig.CompileTestBinary = true
|
||||||
config, err := builder.NewConfig(options)
|
config, err := builder.NewConfig(options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -135,7 +136,6 @@ func Test(pkgName string, options *compileopts.Options) error {
|
|||||||
// For details: https://github.com/golang/go/issues/21360
|
// For details: https://github.com/golang/go/issues/21360
|
||||||
config.Target.BuildTags = append(config.Target.BuildTags, "test")
|
config.Target.BuildTags = append(config.Target.BuildTags, "test")
|
||||||
|
|
||||||
options.TestConfig.CompileTestBinary = true
|
|
||||||
return builder.Build(pkgName, ".elf", config, func(tmppath string) error {
|
return builder.Build(pkgName, ".elf", config, func(tmppath string) error {
|
||||||
cmd := exec.Command(tmppath)
|
cmd := exec.Command(tmppath)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
|||||||
Reference in New Issue
Block a user