From: Akim Demaille Date: Sat, 28 Sep 2002 14:10:11 +0000 (+0000) Subject: * tests/m4sh.at (Functions Support, Functions and return Support): X-Git-Tag: AUTOCONF-2.54a~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaa8ee86fb013e3ed9a6493f37a0675883faea47;p=thirdparty%2Fautoconf.git * tests/m4sh.at (Functions Support, Functions and return Support): New. --- diff --git a/ChangeLog b/ChangeLog index ce5e3948e..994e14ab3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-09-28 Akim Demaille + + * tests/m4sh.at (Functions Support, Functions and return Support): + New. + 2002-09-28 Akim Demaille * bin/Makefile.am (ETAGS_SH, ETAGS_PERL): Update: ifnames and diff --git a/tests/m4sh.at b/tests/m4sh.at index 8b67f93ce..0bdf57825 100644 --- a/tests/m4sh.at +++ b/tests/m4sh.at @@ -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