-
Notifications
You must be signed in to change notification settings - Fork 39
/
check_warnings.sh
32 lines (29 loc) · 1.48 KB
/
check_warnings.sh
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
# -*- indent-tabs-mode: nil -*-
# Software License Agreement - BSD 3-Clause License
#
# Author: Robert Haschke
# Desc: Check for warnings during build process of repo $CI_SOURCE_PATH
packages_with_warnings() {
SOURCE_PKGS=($(catkin_topological_order $CI_SOURCE_PATH --only-names 2> /dev/null))
for pkg in ${SOURCE_PKGS[@]} ; do
# Warnings manifest themselves log files in catkin tools' logs folder
files=$(find $ROS_WS/logs/$pkg -name "*build.cmake.000.log.stderr" -o -name "*build.make.00[01].log.stderr" 2> /dev/null)
# Extract types of failures from file names
issues=""
issues="${issues}$(echo $files | sed -ne 's:.*/build\.cmake\.000.*:cmake :p')"
issues="${issues}$(echo $files | sed -ne 's:.*/build\.make\.000.*:build :p')"
issues="${issues}$(echo $files | sed -ne 's:.*/build\.make\.001.*:test-build :p')"
# Print result
test -n "${files}" && echo -e "- $(colorize YELLOW $(colorize THIN $pkg)): $issues"
done
}
have_warnings=$(packages_with_warnings)
if [ -n "$have_warnings" ] ; then
test "$WARNINGS_OK" == 1 && color=YELLOW || color=RED
travis_run_simple --display "$(colorize $color The following packages have warnings in the shown build steps:)" "echo -e \"$have_warnings\""
echo -e $(colorize BOLD "Please look into the build details and take the time to fix those issues.")
# if warnings are not allowed, fail
test "$WARNINGS_OK" == 0 && exit 2 || true
else
echo -e $(colorize GREEN "No warnings. Great!")
fi