Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tools/build_config/dailyUpdateMakeGCC.sh
169674 views
1
#!/bin/bash
2
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
# Copyright (C) 2008-2025 German Aerospace Center (DLR) and others.
4
# This program and the accompanying materials are made available under the
5
# terms of the Eclipse Public License 2.0 which is available at
6
# https://www.eclipse.org/legal/epl-2.0/
7
# This Source Code may also be made available under the following Secondary
8
# Licenses when the conditions for such availability set forth in the Eclipse
9
# Public License 2.0 are satisfied: GNU General Public License, version 2
10
# or later which is available at
11
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
14
# @file dailyUpdateMakeGCC.sh
15
# @author Michael Behrisch
16
# @date 2008
17
18
# Does the nightly git pull on the Linux / macOS server and then runs build and tests
19
PREFIX=$1
20
export FILEPREFIX=$2
21
export SMTP_SERVER=$3
22
if test $# -ge 4; then
23
CONFIGURE_OPT=$4
24
fi
25
26
MAKELOG=$PREFIX/${FILEPREFIX}make.log
27
MAKEALLLOG=$PREFIX/${FILEPREFIX}makealloptions.log
28
STATUSLOG=$PREFIX/${FILEPREFIX}status.log
29
TESTLOG=$PREFIX/${FILEPREFIX}test.log
30
export SUMO_BATCH_RESULT=$PREFIX/${FILEPREFIX}batch_result
31
export SUMO_REPORT=$PREFIX/${FILEPREFIX}report
32
export SUMO_BINDIR=$PREFIX/sumo/bin
33
# the following are only needed for the clang build but do not hurt others
34
export LSAN_OPTIONS=suppressions=$PREFIX/sumo/build_config/clang_memleak_suppressions.txt,print_suppressions=0
35
export UBSAN_OPTIONS=suppressions=$PREFIX/sumo/build_config/clang_ubsan_suppressions.txt
36
37
rm -f $STATUSLOG
38
echo -n "$(uname -s)_$(uname -m)_$FILEPREFIX " > $STATUSLOG
39
date >> $STATUSLOG
40
echo "--" >> $STATUSLOG
41
if test -e $PREFIX/sumo_test_env/bin/activate; then
42
# activate the virtual environment containing the python packages which are not available via apt
43
source $PREFIX/sumo_test_env/bin/activate
44
fi
45
cd $PREFIX/sumo
46
basename $MAKELOG >> $STATUSLOG
47
git clean -f -x -d -q . &> $MAKELOG || (echo "git clean failed" | tee -a $STATUSLOG; tail -10 $MAKELOG)
48
git pull >> $MAKELOG 2>&1 || (echo "git pull failed" | tee -a $STATUSLOG; tail -10 $MAKELOG)
49
git submodule update >> $MAKELOG 2>&1 || (echo "git submodule update failed" | tee -a $STATUSLOG; tail -10 $MAKELOG)
50
GITREV=`tools/build_config/version.py -`
51
date >> $MAKELOG
52
mkdir -p wheelhouse build/$FILEPREFIX && cd build/$FILEPREFIX
53
cmake ${CONFIGURE_OPT:5} -DCMAKE_INSTALL_PREFIX=$PREFIX ../.. >> $MAKELOG 2>&1 || (echo "cmake failed" | tee -a $STATUSLOG; tail -10 $MAKELOG)
54
if make -j32 >> $MAKELOG 2>&1; then
55
date >> $MAKELOG
56
make lisum >> $MAKELOG 2>&1
57
if make install >> $MAKELOG 2>&1; then
58
if test "$FILEPREFIX" == "gcc"; then
59
make -j distcheck >> $MAKELOG 2>&1 || (echo "make distcheck failed" | tee -a $STATUSLOG; tail -10 $MAKELOG)
60
fi
61
else
62
echo "make install failed" | tee -a $STATUSLOG; tail -10 $MAKELOG
63
fi
64
else
65
echo "make failed" | tee -a $STATUSLOG; tail -20 $MAKELOG
66
fi
67
date >> $MAKELOG
68
echo `grep -ci 'warn[iu]ng:' $MAKELOG` warnings >> $STATUSLOG
69
70
echo "--" >> $STATUSLOG
71
cd $PREFIX/sumo/bin
72
if test -e sumoD; then
73
# it seems the plain build also had the debug config so we symlink to run the tests with the proper binaries
74
for i in *D; do ln -sf ${i} ${i::-1}; done
75
fi
76
cd ..
77
if test -e build/$FILEPREFIX/src/CMakeFiles/sumo.dir/sumo_main.cpp.gcda; then
78
# avoid a dangling symlink for the coverage build
79
mkdir docs/lcov
80
fi
81
if test -e $SUMO_BINDIR/sumo && test $SUMO_BINDIR/sumo -nt build/$FILEPREFIX/Makefile; then
82
# run tests
83
export PATH=$PREFIX/texttest/bin:$PATH
84
export TEXTTEST_TMP=$PREFIX/texttesttmp
85
TESTLABEL=`LANG=C date +%d%b%y`r$GITREV
86
rm -rf $TEXTTEST_TMP/*
87
if test ${FILEPREFIX::6} == "extra_"; then
88
tests/runExtraTests.py --gui "b $FILEPREFIX" &> $TESTLOG
89
elif test "$FILEPREFIX" == "extraNetedit"; then
90
tests/runTests.sh -a neteditoutput -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&1
91
else
92
tests/runTests.sh -b $FILEPREFIX -name $TESTLABEL &> $TESTLOG
93
if which Xvfb &>/dev/null; then
94
if test ${FILEPREFIX::10} == "clangMacOS"; then
95
tests/runTests.sh -a sumo.gui.mac -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&1
96
else
97
tests/runTests.sh -a sumo.gui -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&1
98
fi
99
fi
100
fi
101
tests/runTests.sh -b $FILEPREFIX -name $TESTLABEL -coll >> $TESTLOG 2>&1
102
if test -e build/$FILEPREFIX/src/CMakeFiles/sumo.dir/sumo_main.cpp.gcda; then
103
echo "lcov/html" >> $STATUSLOG
104
echo "Coverage report" >> $STATUSLOG
105
else
106
echo "batchreport" >> $STATUSLOG
107
fi
108
fi
109
110
# running extra tests for the coverage report
111
if test -e build/$FILEPREFIX/src/CMakeFiles/sumo.dir/sumo_main.cpp.gcda; then
112
date >> $TESTLOG
113
tests/runExtraTests.py --gui "b $FILEPREFIX" >> $TESTLOG 2>&1
114
# $SIP_HOME/tests/runTests.sh -b $FILEPREFIX >> $TESTLOG 2>&1
115
cd build/$FILEPREFIX
116
make lcov >> $TESTLOG 2>&1 || (echo "make lcov failed"; tail -10 $TESTLOG)
117
cd $PREFIX/sumo
118
date >> $TESTLOG
119
fi
120
121
echo "--" >> $STATUSLOG
122
basename $MAKEALLLOG >> $STATUSLOG
123
export CXXFLAGS="$CXXFLAGS -Wall -W -pedantic -Wno-long-long -Wformat -Wformat-security"
124
rm -rf build/debug-$FILEPREFIX
125
mkdir build/debug-$FILEPREFIX && cd build/debug-$FILEPREFIX
126
cmake ${CONFIGURE_OPT:5} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PREFIX ../.. > $MAKEALLLOG 2>&1 || (echo "cmake debug failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG)
127
if make -j32 >> $MAKEALLLOG 2>&1; then
128
make install >> $MAKEALLLOG 2>&1 || (echo "make install with all options failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG)
129
else
130
echo "make with all options failed" | tee -a $STATUSLOG; tail -20 $MAKEALLLOG
131
fi
132
cd $PREFIX/sumo
133
echo `grep -ci 'warn[iu]ng:' $MAKEALLLOG` warnings >> $STATUSLOG
134
echo "--" >> $STATUSLOG
135
136
basename $TESTLOG >> $STATUSLOG
137
date >> $STATUSLOG
138
echo "--" >> $STATUSLOG
139
140
# netedit tests
141
if test -e $SUMO_BINDIR/netedit && test $SUMO_BINDIR/netedit -nt build/$FILEPREFIX/Makefile; then
142
if test "$FILEPREFIX" == "gcc"; then
143
# send SIGTERM to the netedit tests after some time and SIGKILL sometime later
144
# This will not work on macOS unless "brew install coreutils" has been executed
145
timeout -k 90m 60m tests/runTests.sh -a netedit.internal -b ${FILEPREFIX} -name $TESTLABEL >> $TESTLOG 2>&1
146
tests/runTests.sh -b ${FILEPREFIX} -name $TESTLABEL -coll >> $TESTLOG 2>&1
147
export SUMO_BATCH_RESULT=$PREFIX/${FILEPREFIX}netedit_ext_batch_result
148
export SUMO_REPORT=$PREFIX/${FILEPREFIX}netedit_ext_report
149
timeout -k 540m 510m tests/runNeteditExternalDailyTests.sh -b ${FILEPREFIX} -name $TESTLABEL >> $TESTLOG 2>&1
150
tests/runTests.sh -b ${FILEPREFIX} -name $TESTLABEL -coll >> $TESTLOG 2>&1
151
killall -9 -q fluxbox Xvfb
152
fi
153
fi
154
155