summaryrefslogtreecommitdiff
path: root/getdefs/test/cfg.test
diff options
context:
space:
mode:
Diffstat (limited to 'getdefs/test/cfg.test')
-rwxr-xr-xgetdefs/test/cfg.test115
1 files changed, 115 insertions, 0 deletions
diff --git a/getdefs/test/cfg.test b/getdefs/test/cfg.test
new file mode 100755
index 0000000..1fb6fb0
--- /dev/null
+++ b/getdefs/test/cfg.test
@@ -0,0 +1,115 @@
+#! /bin/sh
+# -*- Mode: Shell-script -*-
+# cfg.test --- test config file processing
+#
+## Time-stamp: "2011-02-02 12:03:18 bkorb"
+## Author: Bruce Korb <bkorb@gnu.org>
+#
+## This file is part of AutoGen.
+## AutoGen Copyright (c) 1992-2012 by Bruce Korb - all rights reserved
+##
+## AutoGen is free software: you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by the
+## Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## AutoGen is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+## See the GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License along
+## with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if test -z "$srcdir"; then
+ srcdir=`echo "$0" | ${SED} 's,[^/]*$,,'`
+ test -z "$srcdir" && srcdir=.
+ test "$srcdir" = "$0" && srcdir=.
+ test "${VERBOSE+set}" != set && VERBOSE=1
+fi
+. $srcdir/defs
+
+# Create the files we need in the test environment
+cat > ${testname}.c <<- _EOSource_
+
+ /*=* global
+ *
+ * test: subblock
+ * doc: we want to see
+ * just what happens
+ =*/
+
+ /*=gfunc in_p
+ *
+ * exparg: test-string , string to look for
+ + arg-name + arg-desc + arg-opt + arg-list +
+ * exparg: @ string-list @ list of strings to check,, @@ list
+ *
+ * opt: 1
+ * doc:
+ * Return SCM_BOOL_T if the first argument is duplicated
+ * in the second (list) argument.
+ =*/
+ SCM
+ ag_scm_in_p( SCM obj, SCM list )
+ {
+ }
+ _EOSource_
+
+cat > ${testname}.cfg <<- _EOCfg_
+ output ${testname}.out
+ common-assign stumble = grumble
+ assign mumble = stumble ; mumble = grumble
+ template test${testname}
+ subblock exparg=arg_name,arg_desc,arg_optional,arg_list
+ _EOCfg_
+
+cat > ${testname}.test <<- _EOTestOut_
+ /* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ *
+ * DO NOT EDIT THIS FILE (cfg.out)
+ *
+ * It has been extracted by getdefs from the following files:
+ *
+ * cfg.c
+ */
+ autogen definitions testcfg;
+ mumble = stumble ; mumble = grumble;
+
+
+ /* GLOBALDEFS */
+
+ #line 2 "cfg.c"
+ test = 'subblock';
+ doc = 'we want to see
+ just what happens';
+
+
+ #line 9 "cfg.c"
+ gfunc = {
+ name = 'in_p';
+ exparg = {
+ arg_name = 'test-string';
+ arg_desc = 'string to look for';
+ };
+ exparg = {
+ arg_name = 'string-list';
+ arg_desc = 'list of strings to check,,';
+ arg_list = 'list';
+ };
+ opt = '1';
+ doc =
+ 'Return SCM_BOOL_T if the first argument is duplicated
+ in the second (list) argument.';
+ stumble = grumble;
+ };
+ _EOTestOut_
+
+set -x
+${GDexe} load=${testname}.cfg ${testname}.c || \
+ failure running ${GDexe}
+cmp -s ${testname}.test ${testname}.out || \
+ failure "`diff ${testname}.test ${testname}.out`"
+
+# cfg.test ends here