]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* tests/m4sh.at (Functions Support, Functions and return Support):
authorAkim Demaille <akim@epita.fr>
Sat, 28 Sep 2002 14:10:11 +0000 (14:10 +0000)
committerAkim Demaille <akim@epita.fr>
Sat, 28 Sep 2002 14:10:11 +0000 (14:10 +0000)
New.

ChangeLog
tests/m4sh.at

index ce5e3948e66f4dcc61508ccdda2fd93976d9f1ea..994e14ab33a7d3ce64fc40aaaf43bf560dd0cf0a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-09-28  Akim Demaille  <akim@epita.fr>
+
+       * tests/m4sh.at (Functions Support, Functions and return Support):
+       New.
+
 2002-09-28  Akim Demaille  <akim@epita.fr>
 
        * bin/Makefile.am (ETAGS_SH, ETAGS_PERL): Update: ifnames and
index 8b67f93ce230d70b54f8e8f61a749d13ededc341..0bdf57825138d9fa051f184adde5ca34f0f3c8ff 100644 (file)
@@ -272,3 +272,83 @@ AT_CHECK_M4SH
 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