# Checking the output filenames. -*- Autotest -*-
-# Copyright 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2005 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
AT_BANNER([[Output file names.]])
-# AT_CHECK_OUTPUT(INPUT-FILE, [DIRECTIVES], [FLAGS], EXPECTED-FILES)
-# ------------------------------------------------------------------
+# AT_CHECK_OUTPUT(INPUT-FILE, [DIRECTIVES], [FLAGS], EXPECTED-FILES, [SHELLIO])
+# -----------------------------------------------------------------------------
m4_define([AT_CHECK_OUTPUT],
-[AT_SETUP([Output files: $2 & $3.])
+[AT_SETUP([Output files: $2 & $3 $5.])
AT_DATA([$1],
[[$2
%%
-foo: {}
+foo: {};
]])
-AT_CHECK([bison $3 $1], 0)
+AT_CHECK([bison $3 $1 $5], 0)
AT_CHECK([ls $4], [], [ignore])
-AT_CLEANUP($4)
+AT_CLEANUP
])
AT_CHECK_OUTPUT([foo.y], [], [-dv],
[foo.output foo.tab.c foo.tab.h])
+AT_CHECK_OUTPUT([foo.y], [], [-dv],
+ [foo.output foo.tab.c foo.tab.h],
+ [>&-])
AT_CHECK_OUTPUT([foo.y], [], [-dv -o foo.c],
[foo.c foo.h foo.output])
AT_CHECK_OUTPUT([foo.y], [], [-dv -o foo.tab.c],
AT_CHECK_OUTPUT([foo.y], [%defines %verbose %yacc],[],
[y.output y.tab.c y.tab.h])
+AT_CHECK_OUTPUT([foo.yy], [%defines %verbose %yacc],[],
+ [y.output y.tab.c y.tab.h])
+
+# Exercise %output and %file-prefix
+AT_CHECK_OUTPUT([foo.y], [%file-prefix="bar" %defines %verbose], [],
+ [bar.output bar.tab.c bar.tab.h])
+AT_CHECK_OUTPUT([foo.y], [%output="bar.c" %defines %verbose %yacc],[],
+ [bar.output bar.c bar.h])
+AT_CHECK_OUTPUT([foo.y],
+ [%file-prefix="baz" %output="bar.c" %defines %verbose %yacc],
+ [],
+ [bar.output bar.c bar.h])
+
# Check priorities of extension control.
AT_CHECK_OUTPUT([foo.yy], [%defines %verbose], [],