]>
Commit | Line | Data |
---|---|---|
c95f2d78 | 1 | #! /bin/sh |
19c50364 | 2 | # -*- Autoconf -*- |
c95f2d78 AD |
3 | # Validation suite for Bison. |
4 | # Copyright 2000 Free Software Foundation, Inc. | |
5 | ||
6 | AT_INIT([bison]) | |
7 | ||
19c50364 AD |
8 | ## ---------------------------- ## |
9 | ## Checking output file names. ## | |
10 | ## ---------------------------- ## | |
11 | ||
6deb4447 AD |
12 | # AT_CHECK_BISON_FLAGS(FLAGS, EXPECTED-FILES-SORTED) |
13 | # -------------------------------------------------- | |
14 | AT_DEFINE([AT_CHECK_BISON_FLAGS], | |
15 | [AT_SETUP([Output files: $1.]) | |
19c50364 AD |
16 | AT_DATA([foo.y], |
17 | [[%% | |
18 | foo: {} | |
19 | ]]) | |
6deb4447 | 20 | rm -rf $2 |
19c50364 AD |
21 | AT_CHECK([bison -dv foo.y $1], 0, ignore, ignore) |
22 | AT_CHECK([ls $2 | sort | tr '\n' ' ' | sed 's/.$//g'], 0, [$2]) | |
6deb4447 AD |
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]) | |
19c50364 | 32 | |
19c50364 | 33 | |
5d3214b8 | 34 | |
6deb4447 AD |
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]) | |
5d3214b8 AD |
59 | |
60 | AT_INCLUDE([calc.at]) | |
61 | AT_INCLUDE([regression.at]) |