aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/testing/testing.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2021-05-06 18:54:59 +0200
committerRon Evans <[email protected]>2021-05-06 20:04:16 +0200
commit78acbdf0d99f40dd7abe20f822739ca6aadf7304 (patch)
tree99b8ee93833dfd1bfa7d95a33a30e393d307db97 /src/testing/testing.go
parent617e2791efa4ad5231b24a257bc1e822732a15c6 (diff)
downloadtinygo-78acbdf0d99f40dd7abe20f822739ca6aadf7304.tar.gz
tinygo-78acbdf0d99f40dd7abe20f822739ca6aadf7304.zip
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.
Diffstat (limited to 'src/testing/testing.go')
-rw-r--r--src/testing/testing.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go
index 0e352a1a4..88e751ffb 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -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")