tg.run("test", "-p=4", "p1", "p2", "p3", "p4")
}
-func TestCgoConsistentResults(t *testing.T) {
- tooSlow(t)
- if !canCgo {
- t.Skip("skipping because cgo not enabled")
- }
- switch runtime.GOOS {
- case "solaris", "illumos":
- testenv.SkipFlaky(t, 13247)
- }
-
- tg := testgo(t)
- defer tg.cleanup()
- tg.parallel()
- tg.makeTempdir()
- tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
- exe1 := tg.path("cgotest1" + exeSuffix)
- exe2 := tg.path("cgotest2" + exeSuffix)
- tg.run("build", "-o", exe1, "cgotest")
- tg.run("build", "-x", "-o", exe2, "cgotest")
- b1, err := ioutil.ReadFile(exe1)
- tg.must(err)
- b2, err := ioutil.ReadFile(exe2)
- tg.must(err)
-
- if !tg.doGrepMatch(`-fdebug-prefix-map=\$WORK`, &tg.stderr) {
- t.Skip("skipping because C compiler does not support -fdebug-prefix-map")
- }
- if !bytes.Equal(b1, b2) {
- t.Error("building cgotest twice did not produce the same output")
- }
-}
-
// Issue 14444: go get -u .../ duplicate loads errors
func TestGoGetUpdateAllDoesNotTryToLoadDuplicates(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
--- /dev/null
+[short] skip
+[!cgo] skip
+
+[solaris] skip "skipping on Solaris; see golang.org/issue/13247"
+[illumos] skip "skipping on Solaris; see golang.org/issue/13247"
+
+go build -o $WORK/exe1$GOEXE cgotest
+go build -x -o $WORK/exe2$GOEXE cgotest
+
+# TODO(matloob): skip if stderr does not contain '-fdebug-prefix-map=\$WORK'
+
+cmp $WORK/exe1$GOEXE $WORK/exe2$GOEXE
+
+-- cgotest/m.go --
+package cgotest
+
+import "C"
+
+var _ C.int