[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10-test-shell-functions.patch
From: |
Akim Demaille |
Subject: |
10-test-shell-functions.patch |
Date: |
Mon, 30 Sep 2002 09:33:17 +0200 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* tests/m4sh.at (Functions Support, Functions and return Support):
New.
Index: tests/m4sh.at
--- tests/m4sh.at Mon, 20 May 2002 15:30:45 +0200 akim
+++ tests/m4sh.at Sat, 28 Sep 2002 15:50:37 +0200 akim
@@ -272,3 +272,83 @@ m4_define([BASENAME_TEST],
AT_CHECK([./script])
AT_CLEANUP
+
+
+
+
+## ------------------- ##
+## Functions Support. ##
+## ------------------- ##
+
+# Hypothesis: the shell we are running, after having checked for
+# $LINENO support, supports functions.
+
+AT_SETUP([Functions Support])
+
+AT_DATA_M4SH([script.as],
+[[AS_INIT
+_AS_LINENO_PREPARE
+
+func_return () {
+ (exit $1)
+}
+
+func_success () {
+ func_return 0
+}
+
+func_failure () {
+ func_return 1
+}
+
+if func_success; then
+ if func_failure; then
+ AS_ERROR([func_failure passed])
+ fi
+else
+ AS_ERROR([func_success failed])
+fi
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([./script])
+
+AT_CLEANUP
+
+
+
+
+## ------------------------------ ##
+## Functions and return Support. ##
+## ------------------------------ ##
+
+# Hypothesis: the shell we are running, after having checked for
+# $LINENO support, supports functions, and the `return' keyword.
+
+AT_SETUP([Functions and return Support])
+
+AT_DATA_M4SH([script.as],
+[[AS_INIT
+_AS_LINENO_PREPARE
+
+func_success () {
+ return 0
+}
+
+func_failure () {
+ return 1
+}
+
+if func_success; then
+ if func_failure; then
+ AS_ERROR([func_failure passed])
+ fi
+else
+ AS_ERROR([func_success failed])
+fi
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([./script])
+
+AT_CLEANUP
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 10-test-shell-functions.patch,
Akim Demaille <=