bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: minimum perl version


From: Jim Meyering
Subject: Re: minimum perl version
Date: Sat, 04 Sep 2010 12:58:00 +0200

Bruno Haible wrote:
> Hi Jim,
>
>> diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh
>> index 2d1022a..607928d 100755
>> --- a/tests/test-update-copyright.sh
>> +++ b/tests/test-update-copyright.sh
>> @@ -16,6 +16,10 @@
>>  # You should have received a copy of the GNU General Public License
>>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>>
>> +# Skip this test if Perl is too old.  FIXME: 5.6.0 is just a guess.
>> +# We have a report that 5.004_05 is inadequate and that 5.8.8 works.
>> +perl -e 'require 5.6.0' || exit 77
>> +
>>  diffout=`diff -u /dev/null /dev/null 2>&1`
>>  if test x"$diffout" = x"" && test $? -eq 0; then
>>    compare() { diff -u "$@"; }
>
> A little down in this test, there is a check whether perl exists at all.
> It makes no sense IMO to test the perl version, risking a message to stderr
> if it is missing, and then afterwards to test whether perl exists.
>
> Also, when the test is skipped, we should output an explanation why.
> This explanation has already uncovered bugs. A message like
>   "Perl v5.8.0 required--this is only v5.6.0, stopped at -e line 1."
> sounds more like an error message than like an explanation why a test is
> being skipped.
>
> How about this proposed change?
...
>
> + # Skip this test if Perl is too old.  FIXME: 5.8.0 is just a guess.
> + # We have a report that 5.6.1 is inadequate and that 5.8.0 works.
> + perl -e 'require 5.8.0' 2>/dev/null || {
> +   echo '$0: skipping this test; Perl version is too old' 1>&2
> +   exit 77
> + }

Hi Bruno,

Thanks.  Moving the new test down is a definite improvement.
However, I'd prefer to continue to report the offending version of Perl
and the minimum required version.  One way to do that would be
to not suppress stderr.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]