jenkins_make 2.93 KB
Newer Older
1 2 3 4
#!/bin/bash

echo FILTERED BY $0

5 6
# Create a temporary file that contains our script.
SCRIPT=`mktemp`
7 8 9

# Use a bash HEREDOC to provide the script. The delimiter EOF is quoted
# to prevent $ and \ substitution.
10
>$SCRIPT cat - <<'EOF'
11 12 13

# ----- filter gcc warnings, for example:
# /usr/include/boost/date_time/gregorian/conversion.hpp:44: warning: missing initializer ...
14
if (m#^([/._ A-Za-z0-9-]+):([0-9]+):[0-9:]* warning: +(.*)$#) {
15 16 17 18 19 20 21 22 23 24 25
  $file = $1;
  $line = $2;
  $warning = $3;

  # ---- reasons to filter out this line

  # PVSS warnings
  next if $file =~ m#^/opt/WinCC_OA/# && $warning =~ /^unused parameter/;
  next if $file =~ m#^/opt/WinCC_OA/# && $warning =~ /^base class '[^']+' should be explicitly initialized/;
  next if $file =~ m#^/opt/WinCC_OA/# && $warning =~ /^'[^']+' was hidden/;
  next if $file =~ m#^/opt/WinCC_OA/# && $warning =~ /^by '[^']+'/;
26
  next if $file =~ m#^/opt/WinCC_OA/# && $warning =~ /^enumeral and non-enumeral type in conditional expression/;
27 28 29 30 31 32 33 34

  # OpenMPI warnings
  next if $file =~ m#/mpicxx.h$# && $warning =~ /^unused parameter/;

  # Boost warnings
  next if $file =~ m#/boost/date_time/.*/conversion.hpp$# && $warning =~ /^missing initializer/;
  next if $file =~ m#/boost/date_time/time.hpp$#          && $warning =~ /^unused parameter/;
  next if $file =~ m#/boost/date_time/time_facet.hpp$#    && $warning =~ /^unused parameter/;
35 36 37 38 39

  # Blitz warnings
  next if $file =~ m#/blitz/compiler.h$#        && $warning =~ /^"restrict" redefined/;
  next if $file =~ m#/casacore/casa/aipsdef.h$# && $warning =~ /^this is the location of the previous definition/;

40 41 42 43 44
  # CasaRest warnings
  next if $file =~ m#^/opt/cep/casarest/# && $warning =~ /^type qualifiers ignored on function return type/;
  next if $file =~ m#^/opt/cep/casarest/# && $warning =~ /^'[^']+' was hidden/;
  next if $file =~ m#^/opt/cep/casarest/# && $warning =~ /^by '[^']+'/;
  next if $file =~ m#^/opt/cep/casarest/# && $warning =~ /^unused parameter/;
45
  next if $file =~ m#^/opt/cep/casarest/# && $warning =~ /^abstract virtual '[^']+' called from constructor/;
46
  next if $file =~ m#^/opt/cep/casarest/#;
47

48 49
  # Dynamic parts of a static executable
  next if $warning =~ /^Using '[^']+' in statically linked applications requires at runtime the shared libraries/;
50 51 52 53
}

# ------ filter ld warnings, for example:
# SocketStream.cc:(.text+0x482c): warning: Using 'getaddrinfo' in statically linked ...
54 55 56
# (.text+0x2e9c): warning: Using 'endpwent' in statically linked ...
if ( m#^([/._ A-Za-z0-9-]+):\([+.A-Za-z0-9]+\): warning: (.*)$#
  || m#^()\([+.A-Za-z0-9]+\): warning: (.*)$#) {
57 58 59 60 61 62 63 64 65 66 67
  $file = $1;
  $warning = $2;

  # ---- reasons to filter out this line

  # Dynamic parts of a static executable
  next if $warning =~ /^Using '[^']+' in statically linked applications requires at runtime the shared libraries/;
}

# ----- print what was not filtered
print;
68 69

EOF
70 71 72 73

# Run our script on the output of make
make $@ 2>&1 | perl -n $SCRIPT

74 75
MAKESTATUS=${PIPESTATUS[0]}

76
rm -f $SCRIPT
77

78
exit $MAKESTATUS