]>
Commit | Line | Data |
---|---|---|
342b8b6e AD |
1 | # Process this file with autom4te to create testsuite. -*- Autotest -*- |
2 | ||
3 | # Test suite for GNU Bison. | |
9a2b42a3 | 4 | # Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. |
342b8b6e AD |
5 | |
6 | # This program is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 2, or (at your option) | |
9 | # any later version. | |
10 | ||
11 | # This program is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | ||
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with this program; if not, write to the Free Software | |
18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
19 | # 02111-1307, USA. | |
20 | ||
21 | # We need a recent Autotest. | |
d803322e | 22 | m4_version_prereq([2.52g]) |
342b8b6e | 23 | |
1154cced | 24 | |
9501dc6e AD |
25 | # AT_DATA_GRAMMAR_PROLOGUE |
26 | # ------------------------ | |
27 | # The prologue that should be included in any grammar which parser is | |
28 | # meant to be compiled. | |
29 | m4_define([AT_DATA_GRAMMAR_PROLOGUE], | |
30 | [[%{ | |
31 | #if HAVE_CONFIG_H | |
32 | # include <config.h> | |
33 | /* We don't need perfect functions for these tests. */ | |
34 | # undef malloc | |
35 | # undef memcmp | |
36 | # undef realloc | |
37 | #endif | |
38 | %}] | |
39 | ]) | |
40 | ||
41 | ||
42 | # AT_DATA_GRAMMAR(NAME, CONTENT) | |
43 | # ------------------------------ | |
44 | # Generate the file NAME, which CONTENT is preceded by | |
45 | # AT_DATA_GRAMMAR_PROLOGUE. | |
46 | m4_define([AT_DATA_GRAMMAR], | |
47 | [AT_DATA([$1], | |
48 | [AT_DATA_GRAMMAR_PROLOGUE | |
49 | $2]) | |
50 | ]) | |
51 | ||
52 | ||
1154cced AD |
53 | # AT_COMPILE(OUTPUT, [SOURCES = OUTPUT.c]) |
54 | # ---------------------------------------- | |
97c9a05e PE |
55 | # Compile SOURCES into OUTPUT. If OUTPUT does not contain '.', |
56 | # assume that we are linking too; this is a hack. | |
1154cced | 57 | m4_define([AT_COMPILE], |
97c9a05e PE |
58 | [AT_CHECK([$CC $CFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])m4_default([$2], [$1.c]) m4_bmatch([$1], [[.]], [], [$LIBS ])-o $1], |
59 | 0, [], [ignore])]) | |
1154cced | 60 | |
7548fed2 AD |
61 | # AT_COMPILE_CXX(OUTPUT, [SOURCES = OUTPUT.c]) |
62 | # -------------------------------------------- | |
63 | m4_define([AT_COMPILE_CXX], | |
64 | [AT_CHECK([$CXX $CFLAGS $CPPFLAGS m4_default([$2], [$1.c]) -o $1], 0, | |
65 | [], [ignore])]) | |
66 | ||
67 | ||
1154cced AD |
68 | # AT_PARSER_CHECK(COMMAND, EXIT-STATUS, EXPOUT, EXPERR) |
69 | # ----------------------------------------------------- | |
70 | # So that we can run `./testsuite PREPARSER='valgrind -q' for instance. | |
71 | m4_define([AT_PARSER_CHECK], | |
72 | [AT_CHECK([$PREPARSER $1], [$2], [$3], [$4])]) | |
73 | ||
342b8b6e AD |
74 | AT_INIT |
75 | ||
76 | AT_TESTED([bison]) | |
77 | ||
3c31a486 | 78 | # Testing resistance to user bugs. |
9b2d0677 | 79 | m4_include([input.at]) |
3c31a486 AD |
80 | |
81 | # Testing output file names. | |
342b8b6e | 82 | m4_include([output.at]) |
3c31a486 AD |
83 | |
84 | # Testing the part of the engine that computes FOLLOW etc. | |
ed8e1f68 | 85 | m4_include([sets.at]) |
3c31a486 AD |
86 | |
87 | # Testing grammar reduction. | |
cb4956ee | 88 | m4_include([reduce.at]) |
3c31a486 | 89 | |
642cb8f8 AD |
90 | # Testing that #lines are correct. |
91 | m4_include([synclines.at]) | |
92 | ||
3c31a486 | 93 | # Testing that headers are sane. |
b9cecb91 | 94 | m4_include([headers.at]) |
3c31a486 AD |
95 | |
96 | # Testing that user actions are properly performed. | |
82c035a8 | 97 | m4_include([actions.at]) |
3c31a486 AD |
98 | |
99 | # Testing conflicts detection and resolution. | |
100 | m4_include([conflicts.at]) | |
101 | ||
102 | # Fulling testing (compilation and execution of the parser) on calc. | |
342b8b6e | 103 | m4_include([calc.at]) |
3c31a486 | 104 | |
817e9f41 | 105 | # Huge artificial grammars. |
3c31a486 | 106 | # Torturing the stack expansion at runtime. |
6d7d248e | 107 | m4_include([torture.at]) |
3c31a486 | 108 | |
817e9f41 AD |
109 | # Checking big, real world grammars. |
110 | m4_include([existing.at]) | |
111 | ||
3c31a486 | 112 | # Some old bugs. |
342b8b6e | 113 | m4_include([regression.at]) |
676385e2 | 114 | |
9501dc6e | 115 | # GLR tests: |
09903f30 | 116 | # C++ types, simplified |
676385e2 | 117 | m4_include([cxx-type.at]) |
ede3d3bc PH |
118 | # Regression tests |
119 | m4_include([glr-regression.at]) |