1 # Executing Actions. -*- Autotest -*-
2 # Copyright (C) 2002 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 AT_BANNER([[User Actions.]])
21 # AT_TEST_SYNCLINE(TITLE, INPUT, ERROR-MSG)
22 # -----------------------------------------
23 # Check that compiling the parser produced from INPUT cause GCC
25 m4_define([AT_TEST_SYNCLINE],
28 # I'm not sure I can find a generic scheme to check the location
29 # of an error, so we keep this for GCC only.
30 AT_CHECK([test "$GCC" = yes || exit 77])
35 AT_CHECK([bison input.y -o input.c])
36 AT_CHECK([$CC $CFLAGS $CPPFLAGS input.c -o input], 1, [], [stderr])
37 # In case GCC displays column information, strip it down.
39 # input.y:4:2: #error "4" or input.y:4.2: #error "4"
41 # input.y:4: #error "4"
43 AT_CHECK([[sed 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' stderr]],
49 ## --------------------- ##
50 ## Prologue synch line. ##
51 ## --------------------- ##
54 AT_TEST_SYNCLINE([Prologue synch line],
61 [input.y:2: #error "2"
65 ## ------------------- ##
66 ## %union synch line. ##
67 ## ------------------- ##
69 AT_TEST_SYNCLINE([%union synch line],
76 [input.y:2: #error "2"
80 ## ------------------------- ##
81 ## Postprologue synch line. ##
82 ## ------------------------- ##
84 AT_TEST_SYNCLINE([Postprologue synch line],
98 [input.y:9: #error "9"
102 ## ------------------- ##
103 ## Action synch line. ##
104 ## ------------------- ##
106 AT_TEST_SYNCLINE([Action synch line],
113 [input.y:4: #error "4"
117 ## --------------------- ##
118 ## Epilogue synch line. ##
119 ## --------------------- ##
121 AT_TEST_SYNCLINE([Epilogue synch line],
127 [input.y:4: #error "4"