-
Notifications
You must be signed in to change notification settings - Fork 4
/
jenkins_make
executable file
·78 lines (58 loc) · 2.93 KB
/
jenkins_make
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
echo FILTERED BY $0
# Create a temporary file that contains our script.
SCRIPT=`mktemp`
# Use a bash HEREDOC to provide the script. The delimiter EOF is quoted
# to prevent $ and \ substitution.
>$SCRIPT cat - <<'EOF'
# ----- filter gcc warnings, for example:
# /usr/include/boost/date_time/gregorian/conversion.hpp:44: warning: missing initializer ...
if (m#^([/._ A-Za-z0-9-]+):([0-9]+):[0-9:]* warning: +(.*)$#) {
$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 '[^']+'/;
next if $file =~ m#^/opt/WinCC_OA/# && $warning =~ /^enumeral and non-enumeral type in conditional expression/;
# 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/;
# 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/;
# 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/;
next if $file =~ m#^/opt/cep/casarest/# && $warning =~ /^abstract virtual '[^']+' called from constructor/;
next if $file =~ m#^/opt/cep/casarest/#;
# Dynamic parts of a static executable
next if $warning =~ /^Using '[^']+' in statically linked applications requires at runtime the shared libraries/;
}
# ------ filter ld warnings, for example:
# SocketStream.cc:(.text+0x482c): warning: Using 'getaddrinfo' in statically linked ...
# (.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: (.*)$#) {
$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;
EOF
# Run our script on the output of make
make $@ 2>&1 | perl -n $SCRIPT
MAKESTATUS=${PIPESTATUS[0]}
rm -f $SCRIPT
exit $MAKESTATUS