Path: blob/main/tools/build_config/dailyUpdateMakeGCC.sh
193968 views
#!/bin/bash1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2008-2026 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_"; then87if test -e ../cadyts.jar; then88cp ../cadyts.jar $SUMO_BINDIR89fi90tests/runExtraTests.py --gui "b $FILEPREFIX" &> $TESTLOG91else92tests/runTests.sh -b $FILEPREFIX -name $TESTLABEL &> $TESTLOG93if which Xvfb &>/dev/null; then94tests/runTests.sh -a sumo.gui -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&195fi96fi97tests/runTests.sh -b $FILEPREFIX -name $TESTLABEL -coll >> $TESTLOG 2>&198if test -e build/$FILEPREFIX/src/CMakeFiles/sumo.dir/sumo_main.cpp.gcda; then99echo "lcov/html" >> $STATUSLOG100echo "Coverage report" >> $STATUSLOG101else102echo "batchreport" >> $STATUSLOG103fi104fi105106# running extra tests for the coverage report107if test -e build/$FILEPREFIX/src/CMakeFiles/sumo.dir/sumo_main.cpp.gcda; then108date >> $TESTLOG109tests/runExtraTests.py --gui "b $FILEPREFIX" >> $TESTLOG 2>&1110# $SIP_HOME/tests/runTests.sh -b $FILEPREFIX >> $TESTLOG 2>&1111cd build/$FILEPREFIX112make lcov >> $TESTLOG 2>&1 || (echo "make lcov failed"; tail -10 $TESTLOG)113cd $PREFIX/sumo114date >> $TESTLOG115fi116117echo "--" >> $STATUSLOG118basename $MAKEALLLOG >> $STATUSLOG119export CXXFLAGS="$CXXFLAGS -Wall -W -pedantic -Wno-long-long -Wformat -Wformat-security"120rm -rf build/debug-$FILEPREFIX121mkdir build/debug-$FILEPREFIX && cd build/debug-$FILEPREFIX122cmake ${CONFIGURE_OPT:5} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PREFIX ../.. > $MAKEALLLOG 2>&1 || (echo "cmake debug failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG)123if make -j32 >> $MAKEALLLOG 2>&1; then124make install >> $MAKEALLLOG 2>&1 || (echo "make install with all options failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG)125else126echo "make with all options failed" | tee -a $STATUSLOG; tail -20 $MAKEALLLOG127fi128cd $PREFIX/sumo129echo `grep -ci 'warn[iu]ng:' $MAKEALLLOG` warnings >> $STATUSLOG130echo "--" >> $STATUSLOG131132basename $TESTLOG >> $STATUSLOG133date >> $STATUSLOG134echo "--" >> $STATUSLOG135136# netedit tests137if test -e $SUMO_BINDIR/netedit && test $SUMO_BINDIR/netedit -nt build/$FILEPREFIX/Makefile; then138if test "$FILEPREFIX" == "gcc"; then139# send SIGTERM to the netedit tests after some time and SIGKILL sometime later140timeout -k 90m 60m tests/runTests.sh -a netedit.internal -b ${FILEPREFIX} -name $TESTLABEL >> $TESTLOG 2>&1141tests/runTests.sh -b ${FILEPREFIX} -name $TESTLABEL -coll >> $TESTLOG 2>&1142export SUMO_BATCH_RESULT=$PREFIX/${FILEPREFIX}netedit_ext_batch_result143export SUMO_REPORT=$PREFIX/${FILEPREFIX}netedit_ext_report144timeout -k 540m 510m tests/runNeteditExternalDailyTests.sh -b ${FILEPREFIX} -name $TESTLABEL >> $TESTLOG 2>&1145tests/runTests.sh -b ${FILEPREFIX} -name $TESTLABEL -coll >> $TESTLOG 2>&1146killall -9 -q fluxbox Xvfb147fi148if test "$FILEPREFIX" == "clangMacOS_M1"; then149# This will not work on macOS unless "brew install coreutils" has been executed150timeout -k 90m 60m tests/runTests.sh -a netedit.internal -b ${FILEPREFIX} -name $TESTLABEL >> $TESTLOG 2>&1151tests/runTests.sh -b ${FILEPREFIX} -name $TESTLABEL -coll >> $TESTLOG 2>&1152fi153fi154155# macOS upload156if test -e $PREFIX/upload.sh && test ${FILEPREFIX::10} == "clangMacOS"; then157cd $PREFIX158base=$(basename $SUMO_REPORT)159# --disable-copyfile prevents some ._-files to be added by macOS; find -L copies symlinks160tar --disable-copyfile -czhf $base.tar.gz ${FILEPREFIX}*.log $(find -L $base -type f -mtime -2)161./upload.sh $base.tar.gz162fi163164165