From 7bbfddb81b70041250e3c59ce53bea44f7afd2c3 Mon Sep 17 00:00:00 2001 From: doujiang24 Date: Sat, 24 Sep 2022 19:11:09 +0800 Subject: [PATCH] fixed tests. --- src/runtime/crash_cgo_test.go | 10 ++++++++-- src/runtime/testdata/testprogcgo/issue29707.go | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go index 023c89350f..9754b5a4d4 100644 --- a/src/runtime/crash_cgo_test.go +++ b/src/runtime/crash_cgo_test.go @@ -713,7 +713,10 @@ func TestCgoTracebackGoroutineProfile(t *testing.T) { func TestCgoTraceParser(t *testing.T) { // Test issue 29707. - testenv.MustHaveCGO(t) + switch runtime.GOOS { + case "plan9", "windows": + t.Skipf("no pthreads on %s", runtime.GOOS) + } output := runTestProg(t, "testprogcgo", "CgoTraceParser") want := "OK\n" if output != want { @@ -723,7 +726,10 @@ func TestCgoTraceParser(t *testing.T) { func TestCgoTraceParserWithOneProc(t *testing.T) { // Test issue 29707. - testenv.MustHaveCGO(t) + switch runtime.GOOS { + case "plan9", "windows": + t.Skipf("no pthreads on %s", runtime.GOOS) + } output := runTestProg(t, "testprogcgo", "CgoTraceParser", "GOMAXPROCS=1") want := "OK\n" if output != want { diff --git a/src/runtime/testdata/testprogcgo/issue29707.go b/src/runtime/testdata/testprogcgo/issue29707.go index 5d3e65eee4..95964b111b 100644 --- a/src/runtime/testdata/testprogcgo/issue29707.go +++ b/src/runtime/testdata/testprogcgo/issue29707.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build unix +//go:build !plan9 && !windows +// +build !plan9,!windows // This is for issue #29707