Patchwork libgo patch committed: Only run net tests if GCCGO_RUN_ALL_TESTS

login
register
mail settings
Submitter Ian Taylor
Date March 9, 2011, 5:57 a.m.
Message ID <mcrtyfcq1ja.fsf@google.com>
Download mbox | patch
Permalink /patch/86060/
State New
Headers show

Comments

Ian Taylor - March 9, 2011, 5:57 a.m.
This patch to libgo only runs the networking dependent tests if
GCCGO_RUN_ALL_TESTS is set in the environment.  This is PR 48017.  In
that PR Rainer suggests having the tests drop back to UNSUPPORTED or
UNRESOLVED if they fail to open a network connection.  That is tempting
but I don't agree with it, because it means that the tests will never
fail.  It might be better to have some way to test whether the network
is available and usable before running the tests.  However, that is in
itself problematic, as people running all the gcc tests don't
necessarily want their machine to start opening network connections.  So
I think the compromise of requiring an environment variable works well.

Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian
Rainer Orth - March 9, 2011, 3:45 p.m.
Ian Lance Taylor <iant@google.com> writes:

> This patch to libgo only runs the networking dependent tests if
> GCCGO_RUN_ALL_TESTS is set in the environment.  This is PR 48017.  In
> that PR Rainer suggests having the tests drop back to UNSUPPORTED or
> UNRESOLVED if they fail to open a network connection.  That is tempting

My suggestion would have been to only change the test outcome for a `No
route to host' error (which would happen already for the DNS lookup).

> but I don't agree with it, because it means that the tests will never
> fail.  It might be better to have some way to test whether the network

Only if you change the test outcome for all errors, which obviously
isn't appropriate.

> is available and usable before running the tests.  However, that is in
> itself problematic, as people running all the gcc tests don't
> necessarily want their machine to start opening network connections.  So
> I think the compromise of requiring an environment variable works well.

Sort of works for me, but I fear that the tests will be only rarely be
run.  Perhaps the variable should be documented in the libgo/README*
files so at least libgo porters are aware of it.

	Rainer

Patch

diff -r 49a9a1dcc2e8 libgo/Makefile.am
--- a/libgo/Makefile.am	Tue Mar 08 21:28:00 2011 -0800
+++ b/libgo/Makefile.am	Tue Mar 08 21:51:48 2011 -0800
@@ -2952,13 +2952,13 @@ 
 	fmt/check \
 	gob/check \
 	html/check \
-	http/check \
+	$(if $(GCCGO_RUN_ALL_TESTS),http/check) \
 	io/check \
 	json/check \
 	log/check \
 	math/check \
 	mime/check \
-	net/check \
+	$(if $(GCCGO_RUN_ALL_TESTS),net/check) \
 	netchan/check \
 	os/check \
 	patch/check \
@@ -2974,7 +2974,7 @@ 
 	strconv/check \
 	strings/check \
 	sync/check \
-	syslog/check \
+	$(if $(GCCGO_RUN_ALL_TESTS),syslog/check) \
 	tabwriter/check \
 	template/check \
 	time/check \