From: Ian Lance Taylor Date: Thu, 2 Mar 2017 01:31:06 +0000 (-0800) Subject: cmd/go: fix TestFFLAGS for Fortran compilers that accept unknown options X-Git-Tag: go1.9beta1~1351 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a2cc8b20fd6576b1db729159c096aadfb91fbb9e;p=gostls13.git cmd/go: fix TestFFLAGS for Fortran compilers that accept unknown options The test assumed that passing an unknown option to the Fortran compiler would cause the compiler to fail. Unfortunately it appears that some succeed. It's irrelevant to the actual test, which is verifying that the flag was indeed passed. Fixes #19080. Change-Id: Ib9e89447a2104e4742f4b98938373fc2522772aa Reviewed-on: https://go-review.googlesource.com/37658 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Alex Brainman --- diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 06e87798d0..2f8f36b162 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -3795,6 +3795,11 @@ func TestFFLAGS(t *testing.T) { `) tg.tempFile("p/src/p/a.f", `! comment`) tg.setenv("GOPATH", tg.path("p")) - tg.runFail("build", "-x", "p") + + // This should normally fail because we are passing an unknown flag, + // but issue #19080 points to Fortran compilers that succeed anyhow. + // To work either way we call doRun directly rather than run or runFail. + tg.doRun([]string{"build", "-x", "p"}) + tg.grepStderr("no-such-fortran-flag", `missing expected "-no-such-fortran-flag"`) }