bug-coreutils
[Top][All Lists]
Advanced

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

global changes vs. merges


From: Jim Meyering
Subject: global changes vs. merges
Date: Sun, 08 Jun 2008 10:54:44 +0200

Yet another reason any global change is best accompanied by a check to
prevent regression, I was reviewing a change that adds a test that ran
"exec $PERL ..."  from a #!/bin/sh script, like all perl-based tests
did up until about a month ago.  Obviously (if you know the context),
I prefer to use the new #!/usr/bin/perl approach and want to avoid this
regression, but it's far too easy to miss if you weren't involved in
the change.  Of course, the risk is greatest for changes like this, that
were written and at least partially reviewed before the global change,
yet that are merged after it.

Writing the new test made me see that a related one to ensure
uniformity among boiler-plate exec $PERL... lines is no longer
needed, since no such lines remain.


>From 68158e6b1025292c9cc540ffeebe560a0772d255 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 8 Jun 2008 10:30:50 +0200
Subject: [PATCH] syntax-check: detect anachronistic Perl-based tests

* maint.mk (sc_no_exec_perl_coreutils): Rename and rewrite.

---
 maint.mk |   21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/maint.mk b/maint.mk
index ee0e289..5f9f1f0 100644
--- a/maint.mk
+++ b/maint.mk
@@ -421,21 +421,14 @@ sc_GPL_version:
        @grep -n 'either ''version [^3]' $$($(VC_LIST_EXCEPT)) &&       \
          { echo '$(ME): GPL vN, N!=3' 1>&2; exit 1; } || :

-exec_perl_re = \
-  exec \$$PERL -w -I\$$top_srcdir/tests -MCoreutils \
-    -M"CuTmpdir qw(\$$me)" -- - <<\\EOF
-# Ensure that each test invoking $PERL with -MCoreutils uses the same line.
-sc_perl_coreutils_test:
+# Perl-based tests used to exec perl from a #!/bin/sh script.
+# Now they all start with #!/usr/bin/perl and the portability
+# infrastructure is in tests/Makefile.am.  Make sure no old-style
+# script sneaks back in.
+sc_no_exec_perl_coreutils:
        @if test -f $(srcdir)/tests/Coreutils.pm; then                  \
-         die=0;                                                        \
-         for i in $$(grep -l '^exec  *\$$PERL.*MCoreutils'             \
-               $$($(VC_LIST) tests)); do                               \
-           grep '$(exec_perl_re)' $$i > /dev/null                      \
-             && : || { die=1; echo $$i; }                              \
-         done;                                                         \
-         test $$die = 1 &&                                             \
-           { echo 1>&2 '$(ME): each of the above execs PERL differently:'; \
-             echo 1>&2 '(exit $$fail); exit $$fail';                   \
+         grep '^exec  *\$$PERL.*MCoreutils' $$($(VC_LIST) tests) &&    \
+           { echo 1>&2 '$(ME): found anachronistic Perl-based tests';  \
              exit 1; } || :;                                           \
        fi

--
1.5.6.rc1.23.g2f46




reply via email to

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