BUILD: explicitely stop build when compilation/linking issues
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
@@ -959,6 +959,7 @@ function main() {
|
|||||||
wait
|
wait
|
||||||
else
|
else
|
||||||
echo_info "10. Bypassing the Tests ..."
|
echo_info "10. Bypassing the Tests ..."
|
||||||
|
echo_success "BUILD SHOULD BE SUCCESSFUL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,8 +175,21 @@ check_warnings() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#check_errors:
|
||||||
|
# print error message if the compilation had errors
|
||||||
|
#argument:
|
||||||
|
# $1: log file
|
||||||
|
check_errors() {
|
||||||
|
#we look for 'warning:' in the compilation log file
|
||||||
|
error_count=`grep "error:" "$1" | wc -l`
|
||||||
|
if [ $error_count -gt 0 ]; then
|
||||||
|
echo_error "ERROR: $error_count error. See $1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
compilations() {
|
compilations() {
|
||||||
cd $OPENAIR_DIR/cmake_targets/$1/build
|
cd $OPENAIR_DIR/cmake_targets/$1/build
|
||||||
|
echo_info "Log file for compilation is being written to: $dlog/$2.$REL.txt"
|
||||||
set +e
|
set +e
|
||||||
{
|
{
|
||||||
if [ "$BUILD_COVERITY_SCAN" == "1" ]; then
|
if [ "$BUILD_COVERITY_SCAN" == "1" ]; then
|
||||||
@@ -193,15 +206,22 @@ compilations() {
|
|||||||
$COV_SCAN_PREFIX make -j`nproc` $2
|
$COV_SCAN_PREFIX make -j`nproc` $2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
ret=$?
|
||||||
} > $dlog/$2.$REL.txt 2>&1
|
} > $dlog/$2.$REL.txt 2>&1
|
||||||
set -e
|
set -e
|
||||||
echo_info "Log file for compilation has been written to: $dlog/$2.$REL.txt"
|
if [[ $ret -ne 0 ]]; then
|
||||||
|
check_warnings "$dlog/$2.$REL.txt"
|
||||||
|
check_errors "$dlog/$2.$REL.txt"
|
||||||
|
echo_error "$2 compilation failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
if [ -s $3 ] ; then
|
if [ -s $3 ] ; then
|
||||||
cp $3 $4
|
cp $3 $4
|
||||||
echo_success "$2 compiled"
|
echo_success "$2 compiled"
|
||||||
check_warnings "$dlog/$2.$REL.txt"
|
check_warnings "$dlog/$2.$REL.txt"
|
||||||
else
|
else
|
||||||
|
check_warnings "$dlog/$2.$REL.txt"
|
||||||
|
check_errors "$dlog/$2.$REL.txt"
|
||||||
echo_error "$2 compilation failed"
|
echo_error "$2 compilation failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user