[gtk-doc] tests: fix the suppression code



commit ee4ff251f1de101988687692af0eb292882227b2
Author: Stefan Sauer <ensonic users sf net>
Date:   Sun Sep 8 21:04:26 2019 +0200

    tests: fix the suppression code
    
    I could not get multi-line alternatives to work.

 tests/sanity.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/tests/sanity.sh b/tests/sanity.sh
index 1008da2..8c1f2a8 100755
--- a/tests/sanity.sh
+++ b/tests/sanity.sh
@@ -84,11 +84,11 @@ nok=0
 # check that log files have only one line (the command)
 # - discard references to launchapd bugs
 # - discard errors for missing optional tools.
-DISCARD_PATTERN='\(Please fix https://bugs.launchpad.net/ubuntu/+source/gtk-doc/+bug/[0-9]* . For now run:
+DISCARD_PATTERN1='Please fix https://bugs.launchpad.net/ubuntu/+source/gtk-doc/+bug/[0-9]* . For now run:
 gunzip .*.gz
 
-|dblatex or fop must be installed.
-\)'
+'
+DISCARD_PATTERN2='dblatex or fop must be installed.'
 for file in $dir/$suite/docs/gtkdoc-*.log; do
   # skip this in verbose mode as we'll have more text
   if test "x${V}" = "x1"; then
@@ -112,8 +112,8 @@ for file in $dir/$suite/docs/gtkdoc-*.log; do
     ;;
   esac
 
-  #
-  lines=`grep -v -x -G -e "$DISCARD_PATTERN" $file | wc -l | cut -d' ' -f1`
+  # count expected lines
+  lines=`grep -v -x -G -e "$DISCARD_PATTERN1" $file | grep -v -x -G -e "$DISCARD_PATTERN2" | wc -l | cut -d' 
' -f1`
   if test $lines -gt $expected_lines; then
     echo 1>&2 "expected no more than $expected_lines log line in $file, but got $lines"
     nok=`expr $nok + 1`;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]