mirror of
git://git.sv.gnu.org/autoconf
synced 2025-03-31 15:00:26 +08:00
* sh.m4 (AS_BOX, _AS_BOX_LITERAL, _AS_BOX_INDIR): New.
* tests/atgeneral.m4: Use it.
This commit is contained in:
parent
59ecd7666a
commit
bd16bfa0e3
@ -1,3 +1,8 @@
|
||||
2001-01-15 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* sh.m4 (AS_BOX, _AS_BOX_LITERAL, _AS_BOX_INDIR): New.
|
||||
* tests/atgeneral.m4: Use it.
|
||||
|
||||
2001-01-15 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* acgeneral.m4 (AC_VAR_INDIR_IFELSE): Move as...
|
||||
|
@ -192,15 +192,9 @@ fi
|
||||
# over files, the full test suite cleans up both before and after test groups.
|
||||
|
||||
if $1 --version | grep "$at_package.*$at_version" >/dev/null; then
|
||||
at_banner="Testing suite for $at_package, version $at_version"
|
||||
at_dashes=`echo $at_banner | sed s/./=/g`
|
||||
echo "$at_dashes"
|
||||
echo "$at_banner"
|
||||
echo "$at_dashes"
|
||||
AS_BOX([Testing suite for $at_package, version $at_version])
|
||||
else
|
||||
echo '======================================================='
|
||||
echo 'ERROR: Not using the proper version, no tests performed'
|
||||
echo '======================================================='
|
||||
AS_BOX([ERROR: Not using the proper version, no tests performed])
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -277,11 +271,7 @@ elif test $at_debug = false; then
|
||||
at_banner="ERROR: Suite unsuccessful, $at_fail_count of $at_test_count tests failed"
|
||||
fi
|
||||
fi
|
||||
at_dashes=`echo $at_banner | sed s/./=/g`
|
||||
echo
|
||||
echo "$at_dashes"
|
||||
echo "$at_banner"
|
||||
echo "$at_dashes"
|
||||
AS_BOX($at_banner)
|
||||
|
||||
if test $at_debug = false && test -n "$at_failed_list"; then
|
||||
echo
|
||||
|
@ -314,6 +314,33 @@ done; }
|
||||
|
||||
# This section is lexicographically sorted.
|
||||
|
||||
|
||||
# AS_BOX(MESSAGE, [FRAME-CHARACTER = `='])
|
||||
# ----------------------------------------
|
||||
# Output MESSAGE, a single line text, framed with FRAME-CHARACTER (which
|
||||
# must not be `/').
|
||||
m4_define([AS_BOX],
|
||||
[AS_LITERAL_IF([$1],
|
||||
[_AS_BOX_LITERAL($@)],
|
||||
[_AS_BOX_INDIR($@)])])
|
||||
|
||||
# _AS_BOX_LITERAL(MESSAGE, [FRAME-CHARACTER = `='])
|
||||
# -------------------------------------------------
|
||||
m4_define([_AS_BOX_LITERAL],
|
||||
[cat <<\_ASBOX
|
||||
m4_patsubst([$1], [.], m4_if([$2], [], [[=]], [[$2]]))
|
||||
$1
|
||||
m4_patsubst([$1], [.], m4_if([$2], [], [[=]], [[$2]]))
|
||||
_ASBOX])
|
||||
|
||||
# _AS_BOX_INDIR(MESSAGE, [FRAME-CHARACTER = `='])
|
||||
# -----------------------------------------------
|
||||
m4_define([_AS_BOX_INDIR],
|
||||
[sed 'h;s/./m4_default([$2], [=])/g;p;x;p;x' <<_ASBOX
|
||||
$1
|
||||
_ASBOX])
|
||||
|
||||
|
||||
# AS_LITERAL_IF(EXPRESSION, IF-LITERAL, IF-NOT-LITERAL)
|
||||
# -----------------------------------------------------
|
||||
# If EXPRESSION has shell indirections ($var or `expr`), expand
|
||||
|
27
m4sh.m4
27
m4sh.m4
@ -314,6 +314,33 @@ done; }
|
||||
|
||||
# This section is lexicographically sorted.
|
||||
|
||||
|
||||
# AS_BOX(MESSAGE, [FRAME-CHARACTER = `='])
|
||||
# ----------------------------------------
|
||||
# Output MESSAGE, a single line text, framed with FRAME-CHARACTER (which
|
||||
# must not be `/').
|
||||
m4_define([AS_BOX],
|
||||
[AS_LITERAL_IF([$1],
|
||||
[_AS_BOX_LITERAL($@)],
|
||||
[_AS_BOX_INDIR($@)])])
|
||||
|
||||
# _AS_BOX_LITERAL(MESSAGE, [FRAME-CHARACTER = `='])
|
||||
# -------------------------------------------------
|
||||
m4_define([_AS_BOX_LITERAL],
|
||||
[cat <<\_ASBOX
|
||||
m4_patsubst([$1], [.], m4_if([$2], [], [[=]], [[$2]]))
|
||||
$1
|
||||
m4_patsubst([$1], [.], m4_if([$2], [], [[=]], [[$2]]))
|
||||
_ASBOX])
|
||||
|
||||
# _AS_BOX_INDIR(MESSAGE, [FRAME-CHARACTER = `='])
|
||||
# -----------------------------------------------
|
||||
m4_define([_AS_BOX_INDIR],
|
||||
[sed 'h;s/./m4_default([$2], [=])/g;p;x;p;x' <<_ASBOX
|
||||
$1
|
||||
_ASBOX])
|
||||
|
||||
|
||||
# AS_LITERAL_IF(EXPRESSION, IF-LITERAL, IF-NOT-LITERAL)
|
||||
# -----------------------------------------------------
|
||||
# If EXPRESSION has shell indirections ($var or `expr`), expand
|
||||
|
@ -192,15 +192,9 @@ fi
|
||||
# over files, the full test suite cleans up both before and after test groups.
|
||||
|
||||
if $1 --version | grep "$at_package.*$at_version" >/dev/null; then
|
||||
at_banner="Testing suite for $at_package, version $at_version"
|
||||
at_dashes=`echo $at_banner | sed s/./=/g`
|
||||
echo "$at_dashes"
|
||||
echo "$at_banner"
|
||||
echo "$at_dashes"
|
||||
AS_BOX([Testing suite for $at_package, version $at_version])
|
||||
else
|
||||
echo '======================================================='
|
||||
echo 'ERROR: Not using the proper version, no tests performed'
|
||||
echo '======================================================='
|
||||
AS_BOX([ERROR: Not using the proper version, no tests performed])
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -277,11 +271,7 @@ elif test $at_debug = false; then
|
||||
at_banner="ERROR: Suite unsuccessful, $at_fail_count of $at_test_count tests failed"
|
||||
fi
|
||||
fi
|
||||
at_dashes=`echo $at_banner | sed s/./=/g`
|
||||
echo
|
||||
echo "$at_dashes"
|
||||
echo "$at_banner"
|
||||
echo "$at_dashes"
|
||||
AS_BOX($at_banner)
|
||||
|
||||
if test $at_debug = false && test -n "$at_failed_list"; then
|
||||
echo
|
||||
|
Loading…
x
Reference in New Issue
Block a user