]> git.saurik.com Git - bison.git/blob - tests/suite.at
* src/output.c (output): Delete call to reader_output_yylsp.
[bison.git] / tests / suite.at
1 #! /bin/sh
2 # -*- Autoconf -*-
3 # Validation suite for Bison.
4 # Copyright 2000 Free Software Foundation, Inc.
5
6 AT_INIT([bison])
7
8 ## ---------------------------- ##
9 ## Checking output file names. ##
10 ## ---------------------------- ##
11
12 # AT_CHECK_BISON_FLAGS(FLAGS, EXPECTED-FILES-SORTED)
13 # --------------------------------------------------
14 AT_DEFINE([AT_CHECK_BISON_FLAGS],
15 [AT_SETUP([Output files: $1.])
16 AT_DATA([foo.y],
17 [[%%
18 foo: {}
19 ]])
20 rm -rf $2
21 AT_CHECK([bison -dv foo.y $1], 0, ignore, ignore)
22 AT_CHECK([ls $2 | sort | tr '\n' ' ' | sed 's/.$//g'], 0, [$2])
23 rm -f $2
24 AT_CLEANUP
25 ])
26
27 AT_CHECK_BISON_FLAGS([], [foo.output foo.tab.c foo.tab.h])
28 AT_CHECK_BISON_FLAGS([-o foo.c], [foo.c foo.h foo.output])
29 AT_CHECK_BISON_FLAGS([-o foo.tab.c], [foo.output foo.tab.c foo.tab.h])
30 AT_CHECK_BISON_FLAGS([-y], [y.output y.tab.c y.tab.h])
31 AT_CHECK_BISON_FLAGS([-b bar], [bar.output bar.tab.c bar.tab.h])
32
33
34
35 # AT_CHECK_BISON_PERCENT(GRAMMAR-OPTIONS, EXPECTED-FILES-SORTED)
36 # --------------------------------------------------------------
37 AT_DEFINE([AT_CHECK_BISON_PERCENT],
38 [AT_SETUP([Output files: $1.])
39 AT_DATA([foo.y],
40 [[$1
41 %defines
42 %verbose
43 %%
44 foo: {}
45 ]])
46 rm -rf $2
47 AT_CHECK([bison foo.y], 0, ignore, ignore)
48 AT_CHECK([ls $2 | sort | tr '\n' ' ' | sed 's/.$//g'], 0, [$2])
49 rm -f $2
50 AT_CLEANUP
51 ])
52
53 # The sames, but using the % directives.
54 AT_CHECK_BISON_PERCENT([], [foo.output foo.tab.c foo.tab.h])
55 # AT_CHECK_BISON_PERCENT([%output foo.c], [foo.c foo.h foo.output])
56 # AT_CHECK_BISON_PERCENT([%output foo.tab.c], [foo.output foo.tab.c foo.tab.h])
57 AT_CHECK_BISON_PERCENT([%yacc], [y.output y.tab.c y.tab.h])
58 # AT_CHECK_BISON_PERCENT([%file_prefix bar], [bar.output bar.tab.c bar.tab.h])
59
60 AT_INCLUDE([calc.at])
61 AT_INCLUDE([regression.at])