]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/testcshared: skip all but TestExportedSymbols on windows
authorAlex Brainman <alex.brainman@gmail.com>
Thu, 5 Oct 2017 06:43:38 +0000 (17:43 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Thu, 5 Oct 2017 23:11:56 +0000 (23:11 +0000)
TestUnexportedSymbols requires dup2 that
my gcc installation does not have.

TestSignalHandlersWithNotify fails with:
undefined: syscall.SIGIO.

TestSignalHandlers fails with:
sched.h: No such file or directory.

TestExportedSymbolsWithDynamicLoad fails with:
dlfcn.h: No such file or directory.

Also add t.Helper calls to better error messages.

Updates #11058

Change-Id: I7eb514968464256b8337e45f57fcb7d7fe0e4693
Reviewed-on: https://go-review.googlesource.com/68410
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/testcshared/cshared_test.go

index db8b5082fc02ff7db5ce3f1243e96267afe4dd51..0a2e06e7020549673a623fa22634386a3f549b77 100644 (file)
@@ -188,6 +188,7 @@ func adbRun(t *testing.T, env []string, adbargs ...string) string {
 }
 
 func run(t *testing.T, env []string, args ...string) string {
+       t.Helper()
        cmd := exec.Command(args[0], args[1:]...)
        cmd.Env = env
        out, err := cmd.CombinedOutput()
@@ -200,6 +201,7 @@ func run(t *testing.T, env []string, args ...string) string {
 }
 
 func runExe(t *testing.T, env []string, args ...string) string {
+       t.Helper()
        if GOOS == "android" {
                return adbRun(t, env, args...)
        }
@@ -207,6 +209,7 @@ func runExe(t *testing.T, env []string, args ...string) string {
 }
 
 func runCC(t *testing.T, args ...string) string {
+       t.Helper()
        return run(t, nil, append(cc, args...)...)
 }
 
@@ -295,6 +298,11 @@ func TestExportedSymbols(t *testing.T) {
 func TestExportedSymbolsWithDynamicLoad(t *testing.T) {
        t.Parallel()
 
+       if GOOS == "windows" {
+               t.Logf("Skipping on %s", GOOS)
+               return
+       }
+
        cmd := "testp1"
 
        createHeadersOnce(t)
@@ -314,6 +322,11 @@ func TestExportedSymbolsWithDynamicLoad(t *testing.T) {
 func TestUnexportedSymbols(t *testing.T) {
        t.Parallel()
 
+       if GOOS == "windows" {
+               t.Logf("Skipping on %s", GOOS)
+               return
+       }
+
        cmd := "testp2"
        libname := "libgo2." + libSuffix
 
@@ -348,7 +361,11 @@ func TestUnexportedSymbols(t *testing.T) {
 func TestMainExportedOnAndroid(t *testing.T) {
        t.Parallel()
 
-       if GOOS != "android" {
+       switch GOOS {
+       case "android":
+               break
+       default:
+               t.Logf("Skipping on %s", GOOS)
                return
        }
 
@@ -394,12 +411,20 @@ func testSignalHandlers(t *testing.T, pkgname, cfile, cmd string) {
 // test4: test signal handlers
 func TestSignalHandlers(t *testing.T) {
        t.Parallel()
+       if GOOS == "windows" {
+               t.Logf("Skipping on %s", GOOS)
+               return
+       }
        testSignalHandlers(t, "libgo4", "main4.c", "testp4")
 }
 
 // test5: test signal handlers with os/signal.Notify
 func TestSignalHandlersWithNotify(t *testing.T) {
        t.Parallel()
+       if GOOS == "windows" {
+               t.Logf("Skipping on %s", GOOS)
+               return
+       }
        testSignalHandlers(t, "libgo5", "main5.c", "testp5")
 }
 
@@ -410,7 +435,7 @@ func TestPIE(t *testing.T) {
        case "linux", "android":
                break
        default:
-               t.Logf("Skipping TestPIE on %s", GOOS)
+               t.Logf("Skipping on %s", GOOS)
                return
        }