* tests/output.at (AT_CHECK_OUTPUT): Another test, making sure

bison fails when trying to output a parser and a header under the
same name.
* src/files.c (compute_output_file_names): Refuse when parser and
header have the same name.
This commit is contained in:
Akim Demaille
2002-03-04 18:06:42 +00:00
parent 5d08b24fba
commit 4eeb7bc9a2
5 changed files with 43 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ AT_DATA([$1],
foo: {};
]])
AT_CHECK([bison $3 $1], 0)
AT_CHECK([bison $3 $1])
AT_CHECK([ls $4], [], [ignore])
AT_CLEANUP
])
@@ -81,3 +81,15 @@ AT_CHECK_OUTPUT([foo.yy], [],
AT_CHECK_OUTPUT([foo.yy], [],
[-o foo.c++ --graph=foo.gph],
[foo.c++ foo.gph])
# Be sure to reject cases where the parser and the header would have
# the same name.
AT_SETUP([Clashing Output Files.])
AT_DATA([foo.y],
[[%% foo: {};
]])
AT_CHECK([bison -do foo.x foo.y], [1], [],
[foo.y:2: fatal error: header and parser would be both named `foo.x'
])
AT_CLEANUP