switch runtime.GOOS {
case "linux", "darwin", "freebsd", "windows":
- canRace = canCgo && runtime.GOARCH == "amd64"
+ canRace = canCgo && runtime.GOARCH == "amd64" && runtime.Compiler != "gccgo"
}
}
stdout, stderr bytes.Buffer
}
+// skipIfGccgo skips the test if using gccgo.
+func skipIfGccgo(t *testing.T, msg string) {
+ if runtime.Compiler == "gccgo" {
+ t.Skipf("skipping test not supported on gccgo: %s", msg)
+ }
+}
+
// testgo sets up for a test that runs testgo.
func testgo(t *testing.T) *testgoData {
testenv.MustHaveGoBuild(t)
}
func TestProgramNameInCrashMessages(t *testing.T) {
+ skipIfGccgo(t, "gccgo does not use cmd/link")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestGoListStandard(t *testing.T) {
+ skipIfGccgo(t, "gccgo does not GOROOT")
tg := testgo(t)
defer tg.cleanup()
// TODO: tg.parallel()
}
func TestGoInstallDetectsRemovedFiles(t *testing.T) {
+ skipIfGccgo(t, "gccgo does not yet support package build IDs")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestGoInstallDetectsRemovedFilesInPackageMain(t *testing.T) {
+ skipIfGccgo(t, "gccgo does not yet support package build IDs")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestInternalPackagesInGOROOTAreRespected(t *testing.T) {
+ skipIfGccgo(t, "gccgo does not have GOROOT")
tg := testgo(t)
defer tg.cleanup()
tg.runFail("build", "-v", "./testdata/testinternal")
// Issue 12690
func TestPackageNotStaleWithTrailingSlash(t *testing.T) {
+ skipIfGccgo(t, "gccgo does not have GOROOT")
tg := testgo(t)
defer tg.cleanup()
}
func TestGoListCmdOnlyShowsCommands(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no GOROOT")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestLdflagsArgumentsWithSpacesIssue3941(t *testing.T) {
+ skipIfGccgo(t, "gccgo does not support -ldflags -X")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestGoTestCpuprofileLeavesBinaryBehind(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
defer tg.cleanup()
// TODO: tg.parallel()
}
func TestGoTestCpuprofileDashOControlsBinaryLocation(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
defer tg.cleanup()
// TODO: tg.parallel()
}
func TestGoTestMutexprofileLeavesBinaryBehind(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
defer tg.cleanup()
// TODO: tg.parallel()
}
func TestGoTestMutexprofileDashOControlsBinaryLocation(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
defer tg.cleanup()
// TODO: tg.parallel()
}
func TestGoTestDashCDashOControlsBinaryLocation(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestGoTestDashOWritesBinary(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestGoTestDashIDashOWritesBinary(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestShadowingLogic(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
defer tg.cleanup()
pwd := tg.pwd()
}
func TestCoverageWithCgo(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no cover tool")
if !canCgo {
t.Skip("skipping because cgo not enabled")
}
}
func TestGoInstallPkgdir(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
tg.parallel()
defer tg.cleanup()
}
func TestGoTestRaceInstallCgo(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no race detector")
+
switch sys := runtime.GOOS + "/" + runtime.GOARCH; sys {
case "darwin/amd64", "freebsd/amd64", "linux/amd64", "windows/amd64":
// ok
}
func TestGoBuildOutput(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
defer tg.cleanup()
}
func TestIssue13655(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no standard packages")
tg := testgo(t)
defer tg.cleanup()
for _, pkg := range []string{"runtime", "runtime/internal/atomic"} {
func TestLinkXImportPathEscape(t *testing.T) {
// golang.org/issue/16710
+ skipIfGccgo(t, "gccgo does not support -ldflags -X")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
// Issue 18225.
// This is really a cmd/asm issue but this is a convenient place to test it.
func TestConcurrentAsm(t *testing.T) {
+ skipIfGccgo(t, "gccgo does not use cmd/asm")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()