[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
95-as-box.patch
From: |
Akim Demaille |
Subject: |
95-as-box.patch |
Date: |
Sat, 13 Jan 2001 00:19:36 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* sh.m4 (AS_BOX, _AS_BOX_LITERAL, _AS_BOX_INDIR): New.
* tests/atgeneral.m4: Use it.
Index: m4sh.m4
--- m4sh.m4 Fri, 12 Jan 2001 22:50:18 +0100 akim (ace/b/41_m4sh.m4 1.16 644)
+++ m4sh.m4 Fri, 12 Jan 2001 23:14:43 +0100 akim (ace/b/41_m4sh.m4 1.16 644)
@@ -314,6 +314,33 @@ m4_define([AS_MKDIR_P],
# 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
Index: tests/atgeneral.m4
--- tests/atgeneral.m4 Fri, 12 Jan 2001 22:48:19 +0100 akim
(ace/b/19_atgeneral. 1.47 644)
+++ tests/atgeneral.m4 Fri, 12 Jan 2001 23:05:52 +0100 akim
(ace/b/19_atgeneral. 1.47 644)
@@ -192,15 +192,9 @@ m4_define([AT_data_files], [stdout stder
# 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 @@ m4_define([AT_data_files], [stdout stder
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
- 95-as-box.patch,
Akim Demaille <=