From: Stefano Lattarini Date: Sun, 26 Feb 2012 12:31:00 +0000 (+0100) Subject: tests: avoid spurious failure (line too long in awk) X-Git-Tag: v1.11b~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb061d336f318da0adb85ae3002a6e0f4246332f;p=thirdparty%2Fautomake.git tests: avoid spurious failure (line too long in awk) * tests/parallel-tests-many.test: Use perl, not awk, to write the Makefile.am with (deliberately) overly long TESTS content, as some inferior awk implementations (e.g., Solaris 10 /usr/bin/awk) are unable to handle the long lines used there and die with errors like: "awk: string too long near line 5". --- diff --git a/tests/parallel-tests-many.test b/tests/parallel-tests-many.test index 752ba15a4..a09dbe518 100755 --- a/tests/parallel-tests-many.test +++ b/tests/parallel-tests-many.test @@ -87,14 +87,28 @@ END setup_data () { - awk " - BEGIN { - print \"TESTS = \\\\\" - for (i = 1; i < $count; i = i + 1) - print \" $deepdir/$tname-\" i \".test \\\\\" - print \" $deepdir/$tname-\" i \".test\" - } - " > list-of-tests.am || Exit 99 + # Use perl, not awk, to avoid errors like "awk: string too long" + # (seen e.g. with Solaris 10 /usr/bin/awk). + count=$count deepdir=$deepdir tname=$tname $PERL -e ' + use warnings FATAL => "all"; + use strict; + print "TESTS = \\\n"; + my $i = 0; + while (++$i) + { + print " $ENV{deepdir}/$ENV{tname}-$i.test"; + if ($i >= $ENV{count}) + { + print "\n"; + last; + } + else + { + print " \\\n"; + } + } + ' > list-of-tests.am || Exit 99 + sed 20q list-of-tests.am || Exit 99 # For debugging. $AUTOMAKE Makefile \ || framework_failure_ "unexpected automake failure" ./config.status Makefile \