Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tests/runTests.sh
193874 views
1
#!/bin/bash
2
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
# Copyright (C) 2008-2026 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
# Bash script for the test run.
15
# Sets environment variables respecting SUMO_HOME and starts texttest.
16
# The script understands the option --gui to run sumo-gui instead of sumo
17
# and --debug to use the debug versions of the executables.
18
# If they are present, these two options need to come first,
19
# all remaining options are passed directly to texttest.
20
21
# to have reproducible (english) error messages and warnings
22
export LC_ALL=C
23
export LANG=C
24
25
if [[ "$1" == "--gui" ]]; then
26
sumo_suffix="-gui"
27
shift
28
fi
29
if [[ "$1" == "--debug" ]]; then
30
suffix="D"
31
sumo_suffix="${sumo_suffix}D"
32
shift
33
fi
34
if [[ $(uname) == MINGW* || $(uname) == CYGWIN* ]]; then
35
suffix="${suffix}.exe"
36
sumo_suffix="${sumo_suffix}.exe"
37
fi
38
39
pushd $(dirname $0) > /dev/null
40
export TEXTTEST_HOME="$PWD"
41
shopt -s nullglob # expand the pattern to an empty list if no env exists
42
for i in *env/bin/activate; do
43
if [[ "$VIRTUAL_ENV" == "" ]]; then
44
echo "Activating virtual environment $(dirname $(dirname $i))."
45
source $i
46
else
47
echo "Virtual environment $VIRTUAL_ENV already active, ignoring $(dirname $(dirname $i))."
48
fi
49
done
50
if [[ "$SUMO_HOME" == "" ]]; then
51
cd ..
52
export SUMO_HOME="$PWD"
53
fi
54
popd > /dev/null
55
56
# we need to be able to set this separately because in python wheels we want to test the wrapper binaries
57
if [[ "$SUMO_BIN_DIR" == "" ]]; then
58
SUMO_BIN_DIR="$SUMO_HOME/bin"
59
fi
60
61
# for clang sanitizer tests
62
export LSAN_OPTIONS=suppressions="$SUMO_HOME/build_config/clang_memleak_suppressions.txt,print_suppressions=0"
63
export UBSAN_OPTIONS=suppressions="$SUMO_HOME/build_config/clang_ubsan_suppressions.txt"
64
65
export ACTIVITYGEN_BINARY="$SUMO_BIN_DIR/activitygen$suffix"
66
export DFROUTER_BINARY="$SUMO_BIN_DIR/dfrouter$suffix"
67
export DUAROUTER_BINARY="$SUMO_BIN_DIR/duarouter$suffix"
68
export JTRROUTER_BINARY="$SUMO_BIN_DIR/jtrrouter$suffix"
69
export NETCONVERT_BINARY="$SUMO_BIN_DIR/netconvert$suffix"
70
export NETEDIT_BINARY="$SUMO_BIN_DIR/netedit$suffix"
71
export NETGENERATE_BINARY="$SUMO_BIN_DIR/netgenerate$suffix"
72
export OD2TRIPS_BINARY="$SUMO_BIN_DIR/od2trips$suffix"
73
export POLYCONVERT_BINARY="$SUMO_BIN_DIR/polyconvert$suffix"
74
export SUMO_BINARY="$SUMO_BIN_DIR/sumo$sumo_suffix"
75
export GUISIM_BINARY="$SUMO_BIN_DIR/sumo-gui$suffix"
76
export MAROUTER_BINARY="$SUMO_BIN_DIR/marouter$suffix"
77
export PYTHON="python"
78
79
texttest "$@"
80
81