mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 11:37:46 +00:00
main: match go test output
This commit makes the output of `tinygo test` similar to that of `go
test`. It changes the following things in the process:
* Running multiple tests in a single command is now possible. They
aren't paralellized yet.
* Packages with no test files won't crash TinyGo, instead it logs it
in the same way the Go toolchain does.
This commit is contained in:
committed by
Ron Evans
parent
617e2791ef
commit
78acbdf0d9
@@ -201,6 +201,10 @@ type M struct {
|
||||
|
||||
// Run the test suite.
|
||||
func (m *M) Run() int {
|
||||
if len(m.Tests) == 0 {
|
||||
fmt.Fprintln(os.Stderr, "testing: warning: no tests to run")
|
||||
}
|
||||
|
||||
failures := 0
|
||||
for _, test := range m.Tests {
|
||||
t := &T{
|
||||
@@ -226,7 +230,6 @@ func (m *M) Run() int {
|
||||
}
|
||||
|
||||
if failures > 0 {
|
||||
fmt.Printf("exit status %d\n", failures)
|
||||
fmt.Println("FAIL")
|
||||
} else {
|
||||
fmt.Println("PASS")
|
||||
|
||||
Reference in New Issue
Block a user