]> Cypherpunks repositories - gostls13.git/commitdiff
misc: log 'ok' from 'go run' tests on success
authorBryan C. Mills <bcmills@google.com>
Fri, 22 Nov 2019 22:14:25 +0000 (17:14 -0500)
committerBryan C. Mills <bcmills@google.com>
Mon, 25 Nov 2019 16:43:27 +0000 (16:43 +0000)
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>
misc/cgo/testasan/main.go
misc/cgo/testsigfwd/main.go
src/cmd/dist/test.go

index 1837c6cc81de34fc5f8d4552360fd834e6d750da..bc77678c25ad3e5220d8b109d8dad91d29fcb1d5 100644 (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))
 }
index 61bd0da88a839bc20a5a881393413e903b75013c..6d970500781959a71ce04aa93c32dd7c346ac895 100644 (file)
@@ -25,6 +25,7 @@ static void sigsegv() {
 
 static void segvhandler(int signum) {
        if (signum == SIGSEGV) {
+               fprintf(stdout, "ok\ttestsigfwd\n");
                exit(0);  // success
        }
 }
index 2149c697ea5ba67e6b4156c9f77608c08ae0d175..56bdfcac19a1425a3ec4e7e8361c79429c4844fb 100644 (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", ".")
                }
        }