X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/da730230ce159265f4380daa456e3e3c5f9422f4..4ad3921d3be296de6a2b3c5fe0e18136d53ba06d:/tests/synclines.at diff --git a/tests/synclines.at b/tests/synclines.at index d971e546..d7739625 100644 --- a/tests/synclines.at +++ b/tests/synclines.at @@ -1,5 +1,6 @@ # Executing Actions. -*- Autotest -*- -# Copyright (C) 2002, 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2004-2005, 2007, 2009-2010 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 @@ -33,7 +34,26 @@ m4_define([AT_SYNCLINES_COMPILE], # => # input.y:4: #error "4" # -AT_CHECK([[sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^@%:@]*\( @%:@error\)/\1\2/' stderr]], 0, [stdout]) +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# +# And possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed + +AT_CHECK([[sed -e '/^distcc\[[0-9]*\] ERROR: .*/d' \ + -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' \ + -e 's/^\([^:]*:[^:]*:\)[^@%:@]*\( @%:@error\)/\1\2/' \ + -e "/^[^:]*: In function '[^\']*':$/d" \ + stderr]], + 0, [stdout]) ]) # AT_TEST_SYNCLINE(TITLE, INPUT, ERROR-MSG) @@ -70,7 +90,9 @@ AT_CHECK([[test "`cat stdout`" = 'syncline.c:1: @%:@error "1"' || exit 77]]) AT_DATA([[input.y]], [$2]) AT_BISON_CHECK([-o input.c input.y]) AT_SYNCLINES_COMPILE([input.c]) -AT_CHECK([cat stdout], 0, [$3]) +# GCC 4.5 tells you the function within which #error appears, but +# previous versions of gcc do not. +AT_CHECK([grep -v ': In function ' stdout], 0, [$3]) AT_CLEANUP ])