1
0
mirror of https://github.com/golang/go synced 2024-11-11 19:21:37 -07:00

misc: log 'ok' from 'go run' tests on success

Otherwise, these tests produce no output, which can make the overall
output of all.bash a bit tricky to decipher.

Updates #30316
Updates #29062

Change-Id: I33b9e070fd28b9f21ece128e9e603a982c08b7cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/208483
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
Bryan C. Mills 2019-11-22 17:14:25 -05:00
parent 476395cb3e
commit e16f64c094
3 changed files with 10 additions and 2 deletions

View File

@ -36,14 +36,21 @@ thread(void *p)
import "C"
import (
"fmt"
"os"
"path/filepath"
"time"
)
func main() {
start := time.Now()
// ensure that we can function normally
var v [][]byte
for i := 0; i < 1000; i++ {
time.Sleep(10 * time.Microsecond)
v = append(v, make([]byte, 64<<10))
}
fmt.Printf("ok\t%s\t%s\n", filepath.Base(os.Args[0]), time.Since(start).Round(time.Millisecond))
}

View File

@ -25,6 +25,7 @@ static void sigsegv() {
static void segvhandler(int signum) {
if (signum == SIGSEGV) {
fprintf(stdout, "ok\ttestsigfwd\n");
exit(0); // success
}
}

View File

@ -692,7 +692,7 @@ func (t *tester) registerTests() {
t.registerTest("testplugin", "../misc/cgo/testplugin", t.goTest(), t.timeout(600), ".")
}
if gohostos == "linux" && goarch == "amd64" {
t.registerTest("testasan", "../misc/cgo/testasan", "go", "run", "main.go")
t.registerTest("testasan", "../misc/cgo/testasan", "go", "run", ".")
}
if mSanSupported(goos, goarch) {
t.registerHostTest("testsanitizers/msan", "../misc/cgo/testsanitizers", "misc/cgo/testsanitizers", ".")
@ -701,7 +701,7 @@ func (t *tester) registerTests() {
t.registerHostTest("cgo_errors", "../misc/cgo/errors", "misc/cgo/errors", ".")
}
if gohostos == "linux" && t.extLink() {
t.registerTest("testsigfwd", "../misc/cgo/testsigfwd", "go", "run", "main.go")
t.registerTest("testsigfwd", "../misc/cgo/testsigfwd", "go", "run", ".")
}
}