1
0
mirror of https://github.com/golang/go synced 2024-11-22 14:54:46 -07:00

misc/cgo: move easy tests to cmd/cgo/internal

This moves most misc/cgo tests to cmd/cgo/internal. This is mostly a
trivial rename and updating dist/test.go for the new paths, plus
excluding these packages from regular dist test registration. A few
tests were sensitive to what path they ran in, so we update those.

This will let these tests access facilities in internal/testenv.

For #37486.

Change-Id: I3ed417c7c22d9b667f2767c0cb1f59118fcd4af6
Reviewed-on: https://go-review.googlesource.com/c/go/+/492720
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Austin Clements 2023-05-04 12:13:27 -04:00
parent a25688d406
commit bf6c55a8b3
251 changed files with 42 additions and 28 deletions

View File

@ -26,7 +26,7 @@ declared in the preamble may be used, even if they start with a
lower-case letter. Exception: static variables in the preamble may lower-case letter. Exception: static variables in the preamble may
not be referenced from Go code; static functions are permitted. not be referenced from Go code; static functions are permitted.
See $GOROOT/misc/cgo/stdio and $GOROOT/misc/cgo/gmp for examples. See See $GOROOT/cmd/cgo/internal/teststdio and $GOROOT/misc/cgo/gmp for examples. See
"C? Go? Cgo!" for an introduction to using cgo: "C? Go? Cgo!" for an introduction to using cgo:
https://golang.org/doc/articles/c_go_cgo.html. https://golang.org/doc/articles/c_go_cgo.html.

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Test installing a signal handler before the Go code starts. // Test installing a signal handler before the Go code starts.
// This is a lot like misc/cgo/testcshared/main4.c. // This is a lot like ../testcshared/main4.c.
#include <setjmp.h> #include <setjmp.h>
#include <signal.h> #include <signal.h>

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Test os/signal.Notify and os/signal.Reset. // Test os/signal.Notify and os/signal.Reset.
// This is a lot like misc/cgo/testcshared/main5.c. // This is a lot like ../testcshared/main5.c.
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>

View File

@ -4,7 +4,7 @@
// Test that a signal handler that uses up stack space does not crash // Test that a signal handler that uses up stack space does not crash
// if the signal is delivered to a thread running a goroutine. // if the signal is delivered to a thread running a goroutine.
// This is a lot like misc/cgo/testcarchive/main2.c. // This is a lot like ../testcarchive/main2.c.
#include <setjmp.h> #include <setjmp.h>
#include <signal.h> #include <signal.h>

View File

@ -4,7 +4,7 @@
// Test that a signal handler works in non-Go code when using // Test that a signal handler works in non-Go code when using
// os/signal.Notify. // os/signal.Notify.
// This is a lot like misc/cgo/testcarchive/main3.c. // This is a lot like ../testcarchive/main3.c.
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>

View File

@ -63,7 +63,7 @@ func TestFortran(t *testing.T) {
} }
// Do a test build that doesn't involve Go FORTRAN support. // Do a test build that doesn't involve Go FORTRAN support.
fcArgs := append([]string{"helloworld/helloworld.f90", "-o", "/dev/null"}, fcExtra...) fcArgs := append([]string{"testdata/helloworld/helloworld.f90", "-o", "/dev/null"}, fcExtra...)
t.Logf("%s %s", fc, fcArgs) t.Logf("%s %s", fc, fcArgs)
if err := exec.Command(fc, fcArgs...).Run(); err != nil { if err := exec.Command(fc, fcArgs...).Run(); err != nil {
t.Skipf("skipping Fortran test: could not build helloworld.f90 with %s: %s", fc, err) t.Skipf("skipping Fortran test: could not build helloworld.f90 with %s: %s", fc, err)

View File

@ -48,7 +48,7 @@ func testMain(m *testing.M) int {
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
goroot = filepath.Join(cwd, "../../..") goroot = filepath.Join(cwd, "../../../../..")
// Copy testdata into GOPATH/src/testplugin, along with a go.mod file // Copy testdata into GOPATH/src/testplugin, along with a go.mod file
// declaring the same path. // declaring the same path.

Some files were not shown because too many files have changed in this diff Show More