main (tinygo test): fail tests on build error
This fixes a bug where build errors (e.g. linker errors) would be ignored by tinygo test.
Этот коммит содержится в:
родитель
fcd88356db
коммит
edc9319e0d
1 изменённых файлов: 2 добавлений и 1 удалений
3
main.go
3
main.go
|
@ -185,7 +185,7 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
passed := true
|
passed := false
|
||||||
err = builder.Build(pkgName, outpath, config, func(result builder.BuildResult) error {
|
err = builder.Build(pkgName, outpath, config, func(result builder.BuildResult) error {
|
||||||
if testCompileOnly || outpath != "" {
|
if testCompileOnly || outpath != "" {
|
||||||
// Write test binary to the specified file name.
|
// Write test binary to the specified file name.
|
||||||
|
@ -198,6 +198,7 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options
|
||||||
}
|
}
|
||||||
if testCompileOnly {
|
if testCompileOnly {
|
||||||
// Do not run the test.
|
// Do not run the test.
|
||||||
|
passed = true
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче