summaryrefslogtreecommitdiff
path: root/getdefs/test/index.test
blob: 35ad9712be685c2ea307ef67a2a2572d2523dee7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#! /bin/sh
#  -*- Mode: Shell-script -*-
#
# subblock.test --- test the subblock parameter to getdefs
#
# Author:	     Bruce Korb <bkorb@gnu.org>
# Time-stamp:        "2011-02-02 12:04:37 bkorb"
##
##  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/>.

# Common definitions
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 <<EOF
/*=--subblock=exparg=arg_name,arg_desc,arg_optional,arg_list=*/
/*=--listattr=foo=*/

/*=gfunc xtract
 *
 * what:   extract text from another file
 * general_use:
 * exparg: file-name,  name of file with text
 * exparg: marker-fmt, format for marker text
 * exparg: caveat,     warn about changing marker, opt
 * exparg: default,    default initial text,       opt
=*/

/*=gfunc[2] 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.
 * foo:  + bar ++ baz +
=*/
    SCM
ag_scm_in_p( SCM obj, SCM list )
{
}
EOF

cat > ${testname}.test <<_EOF_
/*  -*- buffer-read-only: t -*- vi: set ro:
 *
 *
 *  DO NOT EDIT THIS FILE   (index.out)
 *
 *  It has been extracted by getdefs from the following files:
 *
 *      index.c
 */
autogen definitions testdir;

#line 14 "index.c"
gfunc[2] = {
    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.';
    foo = 'bar','','baz';
};


#line 4 "index.c"
gfunc = {
    name    = 'xtract';
    what = 'extract text from another file';
    general_use;
    exparg = {
        arg_name = 'file-name';
        arg_desc = 'name of file with text';
    };
    exparg = {
        arg_name = 'marker-fmt';
        arg_desc = 'format for marker text';
    };
    exparg = {
        arg_name = 'caveat';
        arg_desc = 'warn about changing marker';
        arg_optional = 'opt';
    };
    exparg = {
        arg_name = 'default';
        arg_desc = 'default initial text';
        arg_optional = 'opt';
    };
};
_EOF_

set -x
${GDexe} output=$testname.out $testname.c || \
	failure running ${GDexe}
cmp -s $testname.test $testname.out || \
	failure "`diff $testname.test $testname.out`"

# subblock.test ends here