From: Akim Demaille Date: Tue, 12 Jun 2012 16:14:49 +0000 (+0200) Subject: tests: strengthen the test on generated headers inclusion X-Git-Tag: v2.6~77 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/9d67a52ad6f9aa1241d64b9766525362715b16e8?ds=inline tests: strengthen the test on generated headers inclusion * tests/headers.at (AT_TEST_CPP_GUARD_H): Accept Bison directives. (Invalid CPP headers): Check glr. --- diff --git a/tests/headers.at b/tests/headers.at index 9d4946d6..9710e0ce 100644 --- a/tests/headers.at +++ b/tests/headers.at @@ -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])