[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU Autoconf source repository branch, master, updated. v2.62-14-g
From: |
Eric Blake |
Subject: |
[SCM] GNU Autoconf source repository branch, master, updated. v2.62-14-gd92dcf1 |
Date: |
Tue, 06 May 2008 12:19:36 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".
http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=d92dcf1e0388d0ac7dcb1b4a566100ad7163dd88
The branch, master has been updated
via d92dcf1e0388d0ac7dcb1b4a566100ad7163dd88 (commit)
from c242f622dcbd6a9c467fe9213254d7ffac3535f3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d92dcf1e0388d0ac7dcb1b4a566100ad7163dd88
Author: Eric Blake <address@hidden>
Date: Tue May 6 06:17:41 2008 -0600
Improve behavior of './testsuite 01'.
* lib/autotest/general.m4 (AT_INIT) <at_func_validate_ranges>:
Alter usage to eval its arguments, in order to normalize away
leading zero. All callers updated.
* tests/autotest.at (Keywords and ranges): Test range
normalization with leading 0.
Signed-off-by: Eric Blake <address@hidden>
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 +++++++++
lib/autotest/general.m4 | 31 +++++++++++++++++++++----------
tests/autotest.at | 35 ++++++++++++++++++++++++++++-------
3 files changed, 58 insertions(+), 17 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 705e71e..59a3119 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-05-06 Eric Blake <address@hidden>
+
+ Improve behavior of './testsuite 01'.
+ * lib/autotest/general.m4 (AT_INIT) <at_func_validate_ranges>:
+ Alter usage to eval its arguments, in order to normalize away
+ leading zero. All callers updated.
+ * tests/autotest.at (Keywords and ranges): Test range
+ normalization with leading 0.
+
2008-04-26 Eric Blake <address@hidden>
Mention Solaris /usr/ucb/tr pitfall.
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 4ce3df7..88d10a3 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -363,7 +363,8 @@ at_func_create_debugging_script ()
# at_func_arith
# -------------
-# Arithmetic evaluation, avoids expr if the shell is sane.
+# Arithmetic evaluation, avoids expr if the shell is sane. The
+# interpretation of leading zeroes is unspecified.
#
# subshell and eval are needed to keep Solaris sh from bailing out:
if ( eval 'test $(( 1 + 1 )) = 2' ) 2>/dev/null; then
@@ -440,17 +441,27 @@ at_format='m4_bpatsubst(m4_defn([AT_ordinal]), [.], [?])'
# Description of all the test groups.
at_help_all="AS_ESCAPE(m4_dquote(m4_defn([AT_help_all])))"
-# at_func_validate_ranges [N...]
-# ------------------------------
-# validate test group ranges
+# at_func_validate_ranges [NAME...]
+# ---------------------------------
+# Validate and normalize the test group number contained in each
+# variable NAME. Leading zeroes are treated as decimal.
at_func_validate_ranges ()
{
for at_grp
do
- if test $at_grp -lt 1 || test $at_grp -gt AT_ordinal; then
- AS_ECHO(["invalid test group: $at_grp"]) >&2
+ eval at_value=\$$at_grp
+ if test $at_value -lt 1 || test $at_value -gt AT_ordinal; then
+ AS_ECHO(["invalid test group: $at_value"]) >&2
exit 1
fi
+ case $at_value in
+ 0*) # We want to treat leading 0 as decimal, like expr and test, but
+ # at_func_arith treats it as octal if it uses $(( )).
+ # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
+ # expr fork, but it is not worth the effort to determine if the
+ # shell supports XSI when the user can just avoid leading 0.
+ eval $at_grp='`expr $at_value + 0`' ;;
+ esac
done
}])])dnl
m4_divert_push([PARSE_ARGS])dnl
@@ -506,14 +517,14 @@ do
;;
[[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]])
- at_func_validate_ranges $at_option
+ at_func_validate_ranges at_option
at_groups="$at_groups$at_option "
;;
# Ranges
[[0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-])
at_range_start=`echo $at_option |tr -d X-`
- at_func_validate_ranges $at_range_start
+ at_func_validate_ranges at_range_start
at_range=`AS_ECHO([" $at_groups_all "]) | \
sed -e 's/^.* \('$at_range_start' \)/\1/'`
at_groups="$at_groups$at_range "
@@ -521,7 +532,7 @@ do
[-[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]])
at_range_end=`echo $at_option |tr -d X-`
- at_func_validate_ranges $at_range_end
+ at_func_validate_ranges at_range_end
at_range=`AS_ECHO([" $at_groups_all "]) | \
sed -e 's/\( '$at_range_end'\) .*$/\1/'`
at_groups="$at_groups$at_range "
@@ -540,7 +551,7 @@ do
at_range_end=$at_range_start
at_range_start=$at_tmp
fi
- at_func_validate_ranges $at_range_start $at_range_end
+ at_func_validate_ranges at_range_start at_range_end
at_range=`AS_ECHO([" $at_groups_all "]) | \
sed -e 's/^.*\( '$at_range_start' \)/\1/' \
-e 's/\( '$at_range_end'\) .*$/\1/'`
diff --git a/tests/autotest.at b/tests/autotest.at
index 7db8451..dc3cfd5 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -677,22 +677,40 @@ AT_SETUP([Keywords and ranges])
AT_CHECK_AT_PREP([k],
[[AT_INIT
-AT_SETUP(none)
+AT_SETUP(none) # 01
AT_CHECK(:)
AT_CLEANUP
-AT_SETUP(first)
+AT_SETUP(first) # 02
AT_KEYWORDS(key1)
AT_CHECK(:)
AT_CLEANUP
-AT_SETUP(second)
+AT_SETUP(second) # 03
AT_KEYWORDS(key2)
AT_CHECK(:)
AT_CLEANUP
-AT_SETUP(both)
+AT_SETUP(both) # 04
AT_KEYWORDS([key1 key2])
AT_KEYWORDS([key1])
AT_CHECK(:)
AT_CLEANUP
+AT_SETUP(test5) # 05
+AT_CHECK(:)
+AT_CLEANUP
+AT_SETUP(test6) # 06
+AT_CHECK(:)
+AT_CLEANUP
+AT_SETUP(test7) # 07
+AT_CHECK(:)
+AT_CLEANUP
+AT_SETUP(test8) # 08
+AT_CHECK(:)
+AT_CLEANUP
+AT_SETUP(test9) # 09
+AT_CHECK(:)
+AT_CLEANUP
+AT_SETUP(test10) # 10
+AT_CHECK(:)
+AT_CLEANUP
]])
dnl check that AT_KEYWORDS does not duplicate words
AT_CHECK([grep 'key1.*key1' k], [1])
@@ -733,21 +751,24 @@ AT_CHECK_KEYS([-k 'eco.*'], [successful], [1],
[none|first|second|both], [0])
AT_CHECK_KEYS([-k 'fir.*'], [first], [1], [none|second|both], [0])
AT_CHECK_KEYS([1-2], [none|first], [2], [second|both], [0])
+AT_CHECK_KEYS([01-002 08], [none|first], [2], [second|both], [0])
AT_CHECK_KEYS([1-3 2-1], [none|first|second], [3], [both], [0])
AT_CHECK_KEYS([-3], [none|first|second], [3], [both], [0])
AT_CHECK_KEYS([4-], [both], [1], [none|first|second], [0])
+AT_CHECK_KEYS([010], [test10], [1], [none|first|second|both], [0])
AT_CHECK_KEYS([-k second 4-], [second|both], [2], [none|first], [0])
AT_CHECK([$CONFIG_SHELL ./k 0], [1], [ignore], [ignore])
AT_CHECK([$CONFIG_SHELL ./k 0-], [1], [ignore], [ignore])
AT_CHECK([$CONFIG_SHELL ./k -0], [1], [ignore], [ignore])
-AT_CHECK([$CONFIG_SHELL ./k 5], [1], [ignore], [ignore])
-AT_CHECK([$CONFIG_SHELL ./k 5-], [1], [ignore], [ignore])
-AT_CHECK([$CONFIG_SHELL ./k 1-5], [1], [ignore], [ignore])
+AT_CHECK([$CONFIG_SHELL ./k 11], [1], [ignore], [ignore])
+AT_CHECK([$CONFIG_SHELL ./k 11-], [1], [ignore], [ignore])
+AT_CHECK([$CONFIG_SHELL ./k 1-011], [1], [ignore], [ignore])
AT_CHECK([$CONFIG_SHELL ./k -k nonexistent], [0], [ignore])
AT_CHECK_KEYS([--list -k nonexistent], [KEYWORDS], [1], [first|second|both],
[0])
AT_CHECK_KEYS([--list 1], [none], [1], [first|second|both], [0])
+AT_CHECK_KEYS([--list 01], [none], [1], [first|second|both], [0])
AT_CHECK_KEYS([--list -k none -k first], [none|first], [2], [second|both], [0])
AT_CLEANUP
hooks/post-receive
--
GNU Autoconf source repository
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU Autoconf source repository branch, master, updated. v2.62-14-gd92dcf1,
Eric Blake <=