Path: blob/main/tools/build_config/dailyUpdateMakeGCC.sh
169674 views
#!/bin/bash1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2008-2025 German Aerospace Center (DLR) and others.3# This program and the accompanying materials are made available under the4# terms of the Eclipse Public License 2.0 which is available at5# https://www.eclipse.org/legal/epl-2.0/6# This Source Code may also be made available under the following Secondary7# Licenses when the conditions for such availability set forth in the Eclipse8# Public License 2.0 are satisfied: GNU General Public License, version 29# or later which is available at10# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later1213# @file dailyUpdateMakeGCC.sh14# @author Michael Behrisch15# @date 20081617# Does the nightly git pull on the Linux / macOS server and then runs build and tests18PREFIX=$119export FILEPREFIX=$220export SMTP_SERVER=$321if test $# -ge 4; then22CONFIGURE_OPT=$423fi2425MAKELOG=$PREFIX/${FILEPREFIX}make.log26MAKEALLLOG=$PREFIX/${FILEPREFIX}makealloptions.log27STATUSLOG=$PREFIX/${FILEPREFIX}status.log28TESTLOG=$PREFIX/${FILEPREFIX}test.log29export SUMO_BATCH_RESULT=$PREFIX/${FILEPREFIX}batch_result30export SUMO_REPORT=$PREFIX/${FILEPREFIX}report31export SUMO_BINDIR=$PREFIX/sumo/bin32# the following are only needed for the clang build but do not hurt others33export LSAN_OPTIONS=suppressions=$PREFIX/sumo/build_config/clang_memleak_suppressions.txt,print_suppressions=034export UBSAN_OPTIONS=suppressions=$PREFIX/sumo/build_config/clang_ubsan_suppressions.txt3536rm -f $STATUSLOG37echo -n "$(uname -s)_$(uname -m)_$FILEPREFIX " > $STATUSLOG38date >> $STATUSLOG39echo "--" >> $STATUSLOG40if test -e $PREFIX/sumo_test_env/bin/activate; then41# activate the virtual environment containing the python packages which are not available via apt42source $PREFIX/sumo_test_env/bin/activate43fi44cd $PREFIX/sumo45basename $MAKELOG >> $STATUSLOG46git clean -f -x -d -q . &> $MAKELOG || (echo "git clean failed" | tee -a $STATUSLOG; tail -10 $MAKELOG)47git pull >> $MAKELOG 2>&1 || (echo "git pull failed" | tee -a $STATUSLOG; tail -10 $MAKELOG)48git submodule update >> $MAKELOG 2>&1 || (echo "git submodule update failed" | tee -a $STATUSLOG; tail -10 $MAKELOG)49GITREV=`tools/build_config/version.py -`50date >> $MAKELOG51mkdir -p wheelhouse build/$FILEPREFIX && cd build/$FILEPREFIX52cmake ${CONFIGURE_OPT:5} -DCMAKE_INSTALL_PREFIX=$PREFIX ../.. >> $MAKELOG 2>&1 || (echo "cmake failed" | tee -a $STATUSLOG; tail -10 $MAKELOG)53if make -j32 >> $MAKELOG 2>&1; then54date >> $MAKELOG55make lisum >> $MAKELOG 2>&156if make install >> $MAKELOG 2>&1; then57if test "$FILEPREFIX" == "gcc"; then58make -j distcheck >> $MAKELOG 2>&1 || (echo "make distcheck failed" | tee -a $STATUSLOG; tail -10 $MAKELOG)59fi60else61echo "make install failed" | tee -a $STATUSLOG; tail -10 $MAKELOG62fi63else64echo "make failed" | tee -a $STATUSLOG; tail -20 $MAKELOG65fi66date >> $MAKELOG67echo `grep -ci 'warn[iu]ng:' $MAKELOG` warnings >> $STATUSLOG6869echo "--" >> $STATUSLOG70cd $PREFIX/sumo/bin71if test -e sumoD; then72# it seems the plain build also had the debug config so we symlink to run the tests with the proper binaries73for i in *D; do ln -sf ${i} ${i::-1}; done74fi75cd ..76if test -e build/$FILEPREFIX/src/CMakeFiles/sumo.dir/sumo_main.cpp.gcda; then77# avoid a dangling symlink for the coverage build78mkdir docs/lcov79fi80if test -e $SUMO_BINDIR/sumo && test $SUMO_BINDIR/sumo -nt build/$FILEPREFIX/Makefile; then81# run tests82export PATH=$PREFIX/texttest/bin:$PATH83export TEXTTEST_TMP=$PREFIX/texttesttmp84TESTLABEL=`LANG=C date +%d%b%y`r$GITREV85rm -rf $TEXTTEST_TMP/*86if test ${FILEPREFIX::6} == "extra_"; then87tests/runExtraTests.py --gui "b $FILEPREFIX" &> $TESTLOG88elif test "$FILEPREFIX" == "extraNetedit"; then89tests/runTests.sh -a neteditoutput -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&190else91tests/runTests.sh -b $FILEPREFIX -name $TESTLABEL &> $TESTLOG92if which Xvfb &>/dev/null; then93if test ${FILEPREFIX::10} == "clangMacOS"; then94tests/runTests.sh -a sumo.gui.mac -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&195else96tests/runTests.sh -a sumo.gui -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&197fi98fi99fi100tests/runTests.sh -b $FILEPREFIX -name $TESTLABEL -coll >> $TESTLOG 2>&1101if test -e build/$FILEPREFIX/src/CMakeFiles/sumo.dir/sumo_main.cpp.gcda; then102echo "lcov/html" >> $STATUSLOG103echo "Coverage report" >> $STATUSLOG104else105echo "batchreport" >> $STATUSLOG106fi107fi108109# running extra tests for the coverage report110if test -e build/$FILEPREFIX/src/CMakeFiles/sumo.dir/sumo_main.cpp.gcda; then111date >> $TESTLOG112tests/runExtraTests.py --gui "b $FILEPREFIX" >> $TESTLOG 2>&1113# $SIP_HOME/tests/runTests.sh -b $FILEPREFIX >> $TESTLOG 2>&1114cd build/$FILEPREFIX115make lcov >> $TESTLOG 2>&1 || (echo "make lcov failed"; tail -10 $TESTLOG)116cd $PREFIX/sumo117date >> $TESTLOG118fi119120echo "--" >> $STATUSLOG121basename $MAKEALLLOG >> $STATUSLOG122export CXXFLAGS="$CXXFLAGS -Wall -W -pedantic -Wno-long-long -Wformat -Wformat-security"123rm -rf build/debug-$FILEPREFIX124mkdir build/debug-$FILEPREFIX && cd build/debug-$FILEPREFIX125cmake ${CONFIGURE_OPT:5} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PREFIX ../.. > $MAKEALLLOG 2>&1 || (echo "cmake debug failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG)126if make -j32 >> $MAKEALLLOG 2>&1; then127make install >> $MAKEALLLOG 2>&1 || (echo "make install with all options failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG)128else129echo "make with all options failed" | tee -a $STATUSLOG; tail -20 $MAKEALLLOG130fi131cd $PREFIX/sumo132echo `grep -ci 'warn[iu]ng:' $MAKEALLLOG` warnings >> $STATUSLOG133echo "--" >> $STATUSLOG134135basename $TESTLOG >> $STATUSLOG136date >> $STATUSLOG137echo "--" >> $STATUSLOG138139# netedit tests140if test -e $SUMO_BINDIR/netedit && test $SUMO_BINDIR/netedit -nt build/$FILEPREFIX/Makefile; then141if test "$FILEPREFIX" == "gcc"; then142# send SIGTERM to the netedit tests after some time and SIGKILL sometime later143# This will not work on macOS unless "brew install coreutils" has been executed144timeout -k 90m 60m tests/runTests.sh -a netedit.internal -b ${FILEPREFIX} -name $TESTLABEL >> $TESTLOG 2>&1145tests/runTests.sh -b ${FILEPREFIX} -name $TESTLABEL -coll >> $TESTLOG 2>&1146export SUMO_BATCH_RESULT=$PREFIX/${FILEPREFIX}netedit_ext_batch_result147export SUMO_REPORT=$PREFIX/${FILEPREFIX}netedit_ext_report148timeout -k 540m 510m tests/runNeteditExternalDailyTests.sh -b ${FILEPREFIX} -name $TESTLABEL >> $TESTLOG 2>&1149tests/runTests.sh -b ${FILEPREFIX} -name $TESTLABEL -coll >> $TESTLOG 2>&1150killall -9 -q fluxbox Xvfb151fi152fi153154155