X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/3f7ca628535da8ee4296061580cc9a944bcf4ab4..ce3448d5b9133a0e6d27d6d36d29f4f7a4316dc7:/tests/output.at diff --git a/tests/output.at b/tests/output.at index 6362ef2d..1343b99a 100644 --- a/tests/output.at +++ b/tests/output.at @@ -1,5 +1,6 @@ # Checking the output filenames. -*- Autotest -*- -# Copyright (C) 2000, 2001, 2002, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2002, 2005, 2006, 2007 Free Software Foundation, +# Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +24,7 @@ AT_BANNER([[Output file names.]]) # [ADDITIONAL-TESTS]) # ----------------------------------------------------------------------------- m4_define([AT_CHECK_OUTPUT], -[AT_SETUP([Output files: $2 $3 $5]) +[AT_SETUP([[Output files: $2 $3 $5]]) case "$1" in */*) mkdir `echo "$1" | sed 's,/.*,,'`;; esac @@ -149,3 +150,49 @@ AT_CHECK_CONFLICTING_OUTPUT([foo.y], [%skeleton "lalr1.cc" %defines], [--graph="location.hh"], [foo.y: warning: conflicting outputs to file `location.hh' ]) + + +# AT_CHECK_OUTPUT_FILE_NAME(FILE-NAME-PREFIX, [ADDITIONAL-TESTS]) +# ----------------------------------------------------------------------------- +m4_define([AT_CHECK_OUTPUT_FILE_NAME], +[AT_SETUP([Output file name: $1]) + +AT_DATA_GRAMMAR([glr.y], +[[%glr-parser +%code { + int yylex (void); + void yyerror (const char *); +} +%% +start: {}; +]]) +AT_CHECK([bison -o "AS_ESCAPE([$1.c])" --defines="AS_ESCAPE([$1.h])" glr.y]) +AT_CHECK([ls "AS_ESCAPE([$1.c])" "AS_ESCAPE([$1.h])"], [], [ignore]) +AT_COMPILE([glr.o], [-c "AS_ESCAPE([$1.c])"]) +$2 + +AT_DATA_GRAMMAR([cxx.y], +[[%skeleton "lalr1.cc" +%code { int yylex (yy::parser::semantic_type*); } +%% +start: {}; +]]) +AT_CHECK([bison -o "AS_ESCAPE([$1.c])" --defines="AS_ESCAPE([$1.h])" cxx.y]) +AT_CHECK([ls "AS_ESCAPE([$1.c])" "AS_ESCAPE([$1.h])"], [], [ignore]) +AT_COMPILE_CXX([cxx.o], [-c "AS_ESCAPE([$1.c])"]) +$2 + +AT_CLEANUP +]) + +# Notice that the header file name here cannot contain +# `"' since FILENAME in `#include "FILENAME"' cannot. +AT_CHECK_OUTPUT_FILE_NAME([[`~!@#$%^&*()-=_+{}[]|\:;<>, .']]) +AT_CHECK_OUTPUT_FILE_NAME([[(]]) +AT_CHECK_OUTPUT_FILE_NAME([[)]]) +AT_CHECK_OUTPUT_FILE_NAME([[#]]) +AT_CHECK_OUTPUT_FILE_NAME([[@@]]) +AT_CHECK_OUTPUT_FILE_NAME([[@{]]) +AT_CHECK_OUTPUT_FILE_NAME([[@}]]) +AT_CHECK_OUTPUT_FILE_NAME([[@<:@]]) +AT_CHECK_OUTPUT_FILE_NAME([[@:>@]])