# 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
# [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
[%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([[@:>@]])