]> Cypherpunks.ru repositories - gostls13.git/commit
misc/cgo/fortran: convert to Go test
authorAustin Clements <austin@google.com>
Fri, 14 Oct 2022 13:51:52 +0000 (09:51 -0400)
committerAustin Clements <austin@google.com>
Mon, 17 Oct 2022 15:15:37 +0000 (15:15 +0000)
commit1e9a7550a846366eda7aaf0b3ebf870791875c17
treeaafc5aaf33ac683c6219b5f9a3105952f1a94dc7
parent03272d14edc48783581058f06b6c17855cb5bd90
misc/cgo/fortran: convert to Go test

Currently, the entry-point to this test is a Bash script that smoke
tests the FORTRAN compiler and then runs a FORTRAN-containing Go test.
This CL rearranges things so a pure Go Go test smoke tests the FORTRAN
compiler and then runs a non-test FORTRAN-containing Go binary.

While we're here, we fix a discrepancy when the host is GOARCH=amd64,
but the target is GOARCH=386. Previously, we would pick the wrong
libgfortran path because we didn't account for the cross-compilation,
causing the link to fail. Except for some reason this was ignored and
the test nevertheless "passed". In the new test we're a little more
strict, so this build failure will cause the test to fail, so we add a
little logic to account for cross-compilation with the host toolchain.

For #37486.

Change-Id: Ie6f70066885d6fbb4e1b5a2b1e13b85dee5b359b
Reviewed-on: https://go-review.googlesource.com/c/go/+/443069
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Austin Clements <austin@google.com>
misc/cgo/fortran/fortran_test.go
misc/cgo/fortran/test.bash [deleted file]
misc/cgo/fortran/testdata/testprog/answer.f90 [moved from misc/cgo/fortran/answer.f90 with 100% similarity]
misc/cgo/fortran/testdata/testprog/fortran.go [moved from misc/cgo/fortran/fortran.go with 58% similarity]
src/cmd/dist/test.go