From: Stefano Lattarini Date: Fri, 20 May 2011 20:31:40 +0000 (+0200) Subject: testsuite: allow tests to avoid the use of 'parallel-tests' option X-Git-Tag: v1.11.1b~26^2~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3352b4e8e52d48fd98cda77750d21a819f5cfd47;p=thirdparty%2Fautomake.git testsuite: allow tests to avoid the use of 'parallel-tests' option * tests/gen-parallel-tests: Do not generate "siblings" for tests that explicitly define the `parallel_tests', whether to "yes" or to any other value. Extend heading comments to give a rationale for this behaviour. * tests/README: Update. --- diff --git a/ChangeLog b/ChangeLog index 53dd132d7..52a729bb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-05-20 Stefano Lattarini + + testsuite: allow tests to avoid the use of 'parallel-tests' option + * tests/gen-parallel-tests: Do not generate "siblings" for tests + that explicitly define the `parallel_tests', whether to "yes" or + to any other value. Extend heading comments to give a rationale + for this behaviour. + * tests/README: Update. + 2011-05-20 Stefano Lattarini tests/README: update obsoleted advice diff --git a/tests/README b/tests/README index 8e4d3e4cf..9680a5472 100644 --- a/tests/README +++ b/tests/README @@ -108,7 +108,10 @@ Do For tests that use the `parallel-tests' Automake option, set the shell variable `parallel_tests' to "yes" before including ./defs. Also, do not use for them a name that ends in `-p.test', since that would - risk to clash with automatically-generated tests. + risk to clash with automatically-generated tests. For tests that are + *not* meant to work with the `parallel-tests' Automake option (these + should be very very few), set the shell variable `parallel_tests' to + "no" before including ./defs. ./defs sets a skeleton configure.in. If possible, append to this file. In some cases you'll have to overwrite it, but this should diff --git a/tests/gen-parallel-tests b/tests/gen-parallel-tests index 39f5d1e2f..451fb7772 100755 --- a/tests/gen-parallel-tests +++ b/tests/gen-parallel-tests @@ -19,6 +19,14 @@ # For each test in the TESTS list in this Makefile.am file, that itself # tests features of the TESTS automake interface, generate a sibling # test that does likewise, but with the option `parallel-tests' enabled. +# Individual tests can prevent the creation of such a sibling by +# explicitly setting the `$parallel_tests' variable to either "yes" or +# "no". The rationale for this is that if the variable is set to "yes", +# the test already uses the `parallel-tests' option, so that a sibling +# would be just a duplicate; while if the variable is set to "no", the +# test doesn't support, or is not meant to run with, the `parallel-tests' +# option, and forcing it to do so in the sibling would likely cause a +# spurious failure. set -e @@ -31,8 +39,7 @@ grep -v '.-p\.test' | LC_ALL=C sort -u | while read tst; do if grep '^[^#]*parallel-tests' $tst >/dev/null \ - || grep "parallel_tests=yes" $tst >/dev/null \ - || grep "parallel_tests=['\"]yes" $tst >/dev/null + || grep "parallel_tests=" $tst >/dev/null then :; else echo $tst; fi; done | {