X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/21cf80399f199a565fc5cffe2cad734313ad4e8f..11d820174fef8e2037ee512f5a5560a2cecd6e1d:/tests/output.at diff --git a/tests/output.at b/tests/output.at index 266a5032..09126774 100644 --- a/tests/output.at +++ b/tests/output.at @@ -1,6 +1,6 @@ # Checking the output filenames. -*- Autotest -*- -# Copyright (C) 2000-2002, 2005-2013 Free Software Foundation, Inc. +# Copyright (C) 2000-2002, 2005-2015 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 @@ -17,12 +17,23 @@ AT_BANNER([[Output file names.]]) +# AT_CHECK_FILES(EXPECTED-FILES, [IGNORED-FILES]) +# ----------------------------------------------- +# Check that the current directory contains FILE... (sorted). +m4_define([AT_CHECK_FILES], +[AT_CHECK([[find . -type f | + $PERL -ne ' + s,\./,,; chomp; + push @file, $_ unless m{^($2|testsuite.log)$}; + END { print join (" ", sort @file), "\n" }']], + [], [$1 +])]) -# AT_CHECK_OUTPUT(INPUT-FILE, [DIRECTIVES], [FLAGS], EXPECTED-FILES, [SHELLIO], +# AT_CHECK_OUTPUT(INPUT-FILE, [DIRECTIVES], [FLAGS], EXPECTED-FILES, [STATUS], # [ADDITIONAL-TESTS], [PRE-TESTS]) # ----------------------------------------------------------------------------- m4_define([AT_CHECK_OUTPUT], -[AT_SETUP([[Output files: ]$2 $3 $5])[ +[AT_SETUP([[Output files: ]$2 $3])[ ]$7[ for file in ]$1 $4[; do case $file in @@ -32,18 +43,12 @@ done ]AT_DATA([$1], [$2[ %% -foo: {}; +foo: %empty {}; ]])[ -]AT_BISON_CHECK([$3 $1 $5], 0)[ +]AT_BISON_CHECK([$3 $1], [$5], [], [ignore])[ # Ignore the files non-generated files -]AT_CHECK([[find . -type f | - $PERL -ne ' - s,\./,,; chomp; - push @file, $_ unless m{^($1|testsuite.log)$}; - END { print join (" ", sort @file), "\n" }']], - [], [$4 -])[ +]AT_CHECK_FILES([$4], [$1])[ ]$6[ ]AT_CLEANUP[ ]]) @@ -54,9 +59,9 @@ AT_CHECK_OUTPUT([foo.y], [], [-dv], # Some versions of Valgrind (at least valgrind-3.6.0.SVN-Debian) report # "fgrep: write error: Bad file descriptor" when stdout is closed, so we # skip this test group during maintainer-check-valgrind. -AT_CHECK_OUTPUT([foo.y], [], [-dv], +AT_CHECK_OUTPUT([foo.y], [], [-dv >&-], [foo.output foo.tab.c foo.tab.h], - [>&-], [], + [], [], [AT_CHECK([[case "$PREBISON" in *valgrind*) exit 77;; esac]])]) AT_CHECK_OUTPUT([foo.y], [], [-dv -o foo.c], @@ -114,6 +119,20 @@ AT_CHECK_OUTPUT([foo.yy], [], [-o foo.c++ --graph=foo.gph], [foo.c++ foo.gph]) +# Do not generate code when there are early errors (even warnings as +# errors). +AT_CHECK_OUTPUT([foo.y], [%type useless], + [--defines --graph --xml --report=all -Wall -Werror], + [foo.dot foo.output foo.xml], + [1]) + +# Do not generate code when there are late errors (even warnings as +# errors). +AT_CHECK_OUTPUT([foo.y], [%define useless], + [--defines --graph --xml --report=all -Wall -Werror], + [foo.dot foo.output foo.xml], + [1]) + ## ------------ ## ## C++ output. ##