public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [libgo] Use /usr/bin/pwd in os_test.TestStartProcess on Solaris (PR go/48502)
@ 2011-05-23 11:55 Rainer Orth
  2011-05-25  8:48 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Rainer Orth @ 2011-05-23 11:55 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ian Lance Taylor

As described in the PR, the go libgo test fails on Solaris since /bin is
a symlink to /usr/bin.  Since there is other OS-specific code in
os_test.go, I'm using the follwing patch to fix this.

With that patch, libgo test results on i386-pc-solaris2.11 are clean.

	Rainer


2011-05-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR go/48502
	* go/os/os_test.go (TestStartProcess): Use /usr/bin/pwd on Solaris.

diff --git a/libgo/go/os/os_test.go b/libgo/go/os/os_test.go
--- a/libgo/go/os/os_test.go
+++ b/libgo/go/os/os_test.go
@@ -440,7 +440,12 @@ func TestStartProcess(t *testing.T) {
 		args = []string{"/c", "cd"}
 	} else {
 		le = "\n"
-		cmd = "/bin/pwd"
+		// /bin is a symlink to /usr/bin on Solaris.
+		if syscall.OS == "solaris" {
+			cmd = "/usr/bin/pwd"
+		} else {
+			cmd = "/bin/pwd"
+		}
 		dir = "/"
 		args = []string{}
 	}


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [libgo] Use /usr/bin/pwd in os_test.TestStartProcess on Solaris (PR go/48502)
  2011-05-23 11:55 [libgo] Use /usr/bin/pwd in os_test.TestStartProcess on Solaris (PR go/48502) Rainer Orth
@ 2011-05-25  8:48 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2011-05-25  8:48 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> As described in the PR, the go libgo test fails on Solaris since /bin is
> a symlink to /usr/bin.  Since there is other OS-specific code in
> os_test.go, I'm using the follwing patch to fix this.

I committed this patch instead, to the upstream library and to gccgo.
Let me know if it doesn't work.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 511 bytes --]

diff -r f58704837aa1 libgo/go/os/os_test.go
--- a/libgo/go/os/os_test.go	Tue May 24 15:02:48 2011 -0700
+++ b/libgo/go/os/os_test.go	Tue May 24 22:54:38 2011 -0700
@@ -437,7 +437,8 @@
 	var b bytes.Buffer
 	io.Copy(&b, r)
 	output := b.String()
-	if output != expect {
+	// Accept /usr prefix because Solaris /bin is symlinked to /usr/bin.
+	if output != expect && output != "/usr"+expect {
 		t.Errorf("exec %q returned %q wanted %q",
 			strings.Join(append([]string{cmd}, args...), " "), output, expect)
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-25  5:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23 11:55 [libgo] Use /usr/bin/pwd in os_test.TestStartProcess on Solaris (PR go/48502) Rainer Orth
2011-05-25  8:48 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).