diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2016-10-24 11:23:36 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2016-10-24 11:23:36 +0000 |
commit | e77cf8c6d64a3561fd1bbe3c9cf30aa985b90bef (patch) | |
tree | 37b3798ca462a682fdc315b8fb19cc2aebb3fcae /contrib | |
parent | 40f683e88d5aeef52425f719a7197da4d1d524a7 (diff) | |
download | gcc-e77cf8c6d64a3561fd1bbe3c9cf30aa985b90bef.tar.gz |
[check_GNU_style.sh] More aggressively ignore dg-xxx directives
* check_GNU_style.sh (remove_testsuite): New function.
Use it to remove testsuite from the diff.
From-SVN: r241471
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ChangeLog | 5 | ||||
-rwxr-xr-x | contrib/check_GNU_style.sh | 18 |
2 files changed, 19 insertions, 4 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 0978df51dbf..1b6939ad030 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +2016-10-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * check_GNU_style.sh (remove_testsuite): New function. + Use it to remove testsuite from the diff. + 2016-09-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * dg-extract-results.sh: Revert bogus change. diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh index 87a276c9cf4..fb7494661ee 100755 --- a/contrib/check_GNU_style.sh +++ b/contrib/check_GNU_style.sh @@ -81,7 +81,17 @@ if [ $nfiles -eq 1 ]; then else format="-nH" fi + +# Remove the testsuite part of the diff. We don't care about GNU style +# in testcases and the dg-* directives give too many false positives. +remove_testsuite () +{ + awk 'BEGIN{testsuite=0} /^(.*:)?([1-9][0-9]*:)?\+\+\+ / && ! /testsuite\//{testsuite=0} \ + {if (!testsuite) print} /^(.*:)?([1-9][0-9]*:)?\+\+\+ (.*\/)?testsuite\//{testsuite=1}' +} + grep $format '^+' $files \ + | remove_testsuite \ | grep -v ':+++' \ > $inp @@ -160,8 +170,9 @@ col (){ fi # Don't reuse $inp, which may be generated using -H and thus contain a - # file prefix. - grep -n '^+' $f \ + # file prefix. Re-remove the testsuite since we're not using $inp. + cat $f | remove_testsuite \ + | grep -n '^+' \ | grep -v ':+++' \ > $tmp @@ -174,11 +185,10 @@ col (){ # Expand tabs to spaces according to tab positions. # Keep long lines, make short lines empty. Print the part past 80 chars # in red. - # Don't complain about dg-xxx directives in tests. cat "$tmp" \ | sed 's/^[0-9]*:+//' \ | expand \ - | awk '$0 !~ /{[[:space:]]*dg-(error|warning|message)[[:space:]]/ { \ + | awk '{ \ if (length($0) > 80) \ printf "%s\033[1;31m%s\033[0m\n", \ substr($0,1,80), \ |