]> git.saurik.com Git - bison.git/commitdiff
tests: strengthen the test on generated headers inclusion
authorAkim Demaille <akim@lrde.epita.fr>
Tue, 12 Jun 2012 16:14:49 +0000 (18:14 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Fri, 15 Jun 2012 11:31:59 +0000 (13:31 +0200)
* tests/headers.at (AT_TEST_CPP_GUARD_H): Accept Bison directives.
(Invalid CPP headers): Check glr.

tests/headers.at

index 9d4946d676ce5f8e407905f7bdac8a012590eed7..9710e0ce930c032ce34c42e2a57905ce4f856340 100644 (file)
@@ -46,17 +46,19 @@ AT_CLEANUP
 ## Invalid CPP headers.  ##
 ## --------------------- ##
 
-# AT_TEST_CPP_GUARD_H([INPUT-FILE-BASE)
-# -------------------------------------
+# AT_TEST_CPP_GUARD_H(BASE-NAME, [DIRECTIVES])
+# --------------------------------------------
+# FIXME: Much of this can be covered by calc.at.
 m4_define([AT_TEST_CPP_GUARD_H],
-[AT_SETUP([Invalid CPP guards: $1])
+[AT_SETUP([Invalid CPP guards: $2 --defines=$1.h])
 
 # Possibly create inner directories.
 dirname=`AS_DIRNAME([$1])`
 AS_MKDIR_P([$dirname])
 
 AT_DATA_GRAMMAR([$1.y],
-[%{
+[$2
+%{
 #include <$1.h>
 void yyerror (const char *);
 int yylex (void);
@@ -67,15 +69,17 @@ dummy:;
 #include <$1.h>
 ])
 
-AT_BISON_CHECK([--defines=$1.h --output=y.tab.c $1.y])
+AT_BISON_CHECK([--defines=$1.h --output=$1.c $1.y])
 
-AT_COMPILE([y.tab.o], [-I. -c y.tab.c])
+AT_COMPILE([$1.o], [-I. -c $1.c])
 
 AT_CLEANUP
 ])
 
 AT_TEST_CPP_GUARD_H([input/input])
 AT_TEST_CPP_GUARD_H([9foo])
+AT_TEST_CPP_GUARD_H([input/input], [%glr-parser])
+AT_TEST_CPP_GUARD_H([9foo],        [%glr-parser])