[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2.53a m4sh.at:74 failure
From: |
Akim Demaille |
Subject: |
Re: 2.53a m4sh.at:74 failure |
Date: |
25 Apr 2002 19:27:52 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) |
| On Thu, Apr 25, 2002 at 02:40:14PM +0200, Akim Demaille wrote:
| >
| > Thanks,
| >
| > I think I have it!
| >
| > Question: do you have a testsuite.lineno in tests?
|
| Yes
|
| > I'm quite sure it
| > is so. Also, I bet that diff -u testsuite testsuite.lineno will have
| > somewhere a
| >
| > - Line: $LINENO
| > + Line: 2897
|
| Yes.
|
| Ah finally! That is where
| cat >test/test-1.as <<'_ATEOF'
| AS_INIT
| if false; then
| # If we can't unset LINENO, then this test makes no sense: skip it.
| AS_UNSET([LINENO]) ||
| AS_ERROR([cannot unset LINENO], 77)
| fi
| _AS_PREPARE
| echo "Line: 2897"
| grep 'Line: .*LINENO' $[0] >/dev/null ||
| AS_ERROR([cannot find original script])
| exit 0
| _ATEOF
|
| lives.
|
| I just had a go at:
|
| m4_define([AT_PACKAGE_STRING],[small check])
| m4_define([AT_PACKAGE_BUGREPORT],[me])
| AT_CONFIG([.])
| AT_INIT
| m4_pattern_allow([^AS_EXIT$])
| AT_SETUP([LINENO])
| _AS_LINENO_WORKS || {
| echo "Lineno doesn't work";
| }
|
| exit;
|
| Which is actually bad syntax, so I fiddled it to:
|
| case $at_group in
| 1 ) # 1. small.at:12: LINENO
| at_setup_line='small.at:12'
| $at_verbose "1. small.at:12: testing LINENO..."
| $at_quiet $ECHO_N " 1: small.at:12 $ECHO_C"
| (
| $at_traceon
|
|
|
| as_lineno_1=$LINENO
| as_lineno_2=$LINENO
| as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
| if ( test "x$as_lineno_1" != "x$as_lineno_2" &&
| test "x$as_lineno_3" = "x$as_lineno_2" )
| then echo "Lineno does work";
| else echo "Lineno doesn't work";
| fi;
|
| and surprisingly got:
|
| % sh foobar
| ## ----------------------- ##
| ## small check test suite. ##
| ## ----------------------- ##
| 1: small.at:12 Lineno does work
| ok
I'm a bit lost with your changes. Do you submit a patch? I guess you
understood the problem: testsuite detected your shell does not support
LINENO properly, so it rewrote testsuite into testsuite.lineno. Then
of course, when it comes to checking $LINENO of test-1, you actually
get the lineno of testsuite...
Here is my pre-proposal. I still have to adjust the comments, make
the ChangeLog etc.
Index: tests/m4sh.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/m4sh.at,v
retrieving revision 1.33
diff -u -u -r1.33 m4sh.at
--- tests/m4sh.at 22 Apr 2002 12:18:36 -0000 1.33
+++ tests/m4sh.at 25 Apr 2002 17:27:14 -0000
@@ -42,13 +42,13 @@
#
# Use COUNTER, COUNTER-RE = [$@&address@hidden, [LINENO]
# or = [__@&address@hidden, [_oline__]
-# to make sure we are not replace in the test suite itself and to avoid
+# to make sure we are not replaced in the test suite itself and to avoid
# seeing the COUNTER-RE being replaced.
#
# UNSET-LINENO is a shell condition to make sure the scripts have the
# same number of lines in the output, so that their outputs be identical.
m4_define([AT_DATA_LINENO],
-[AT_DATA([$1],
+[AT_DATA([$1.as],
[[AS@&address@hidden
if $2; then
AS@&address@hidden([LINENO])
@@ -59,13 +59,16 @@
AS@&address@hidden([cannot find original script])
exit 0
]])
+AT_CHECK([autom4te -l m4sh $1.as -o $1.t])
+# If an occurrence of $LINENO was wanted, create it.
+sed 's/DOLLAR_LINENO/$''LINENO/g' $1.t >$1
+chmod +x $1
])# AT_DATA_LINENO
# `_oline_', once processed and ran, produces our reference.
# We check that we find ourselves by looking at a string which is
# available only in the original script: `_oline_'.
-AT_DATA_LINENO([reference.as], [false], [__@&address@hidden, [_oline__])
-AT_CHECK([autom4te -l m4sh reference.as -o reference])
+AT_DATA_LINENO([reference], [false], [__@&address@hidden, [_oline__])
AT_CHECK([./reference], 0, [stdout])
# The reference:
@@ -75,16 +78,14 @@
# Be sure to be out of the PATH.
AT_CHECK([mkdir test || exit 77])
-AT_DATA_LINENO([test/test-1.as], [false], [$@&address@hidden, [LINENO])
-AT_CHECK([autom4te -l m4sh test/test-1.as -o test/test-1])
+AT_DATA_LINENO([test/test-1], [false], [DOLLAR_LINENO], [LINENO])
AT_CHECK([./test/test-1], 0, [expout])
AT_CHECK([(PATH=test$PATH_SEPARATOR$PATH; export PATH; exec test-1)],
0, [expout])
AT_CHECK([sh ./test/test-1], 0, [expout])
# Now using a disabled LINENO, with different call conventions.
-AT_DATA_LINENO([test/test-2.as], [true], [$@&address@hidden, [LINENO])
-AT_CHECK([autom4te -l m4sh test/test-2.as -o test/test-2])
+AT_DATA_LINENO([test/test-2], [true], [DOLLAR_LINENO], [LINENO])
AT_CHECK([./test/test-2], 0, [expout])
AT_CHECK([(PATH=test$PATH_SEPARATOR$PATH; export PATH; exec test-2)],
0, [expout])