autotest: fixed valgrind options to sim_arduplane.sh

This commit is contained in:
Andrew Tridgell 2014-03-11 09:37:02 +11:00
parent 784034170d
commit a26bcddb9b
2 changed files with 18 additions and 21 deletions

View File

@ -3,23 +3,18 @@
# Try to run a command in an appropriate type of terminal window
# depending on whats available
# Sigh: theres no common way of handling command line args :-(
function run_in_terminal_window()
{
name="$1"
shift
echo "Starting $name : $*"
# default to xterm as it has the most consistent options and can start minimised
if [ -x /usr/bin/xterm ]; then
/usr/bin/xterm -iconic -n "$name" -name "$name" -T "$name" -hold -e $* &
elif [ -x /usr/bin/konsole ]; then
/usr/bin/konsole --hold -e $*
elif [ -x /usr/bin/gnome-terminal ]; then
/usr/bin/gnome-terminal -e "$*"
else
echo "ERROR: Please install xterm"
exit 1
fi
}
run_in_terminal_window $*
name="$1"
shift
echo "Starting $name : $*"
# default to xterm as it has the most consistent options and can start minimised
if [ -x /usr/bin/xterm ]; then
/usr/bin/xterm -iconic -n "$name" -name "$name" -T "$name" -hold -e $* &
elif [ -x /usr/bin/konsole ]; then
/usr/bin/konsole --hold -e $*
elif [ -x /usr/bin/gnome-terminal ]; then
/usr/bin/gnome-terminal -e "$*"
else
echo "ERROR: Please install xterm"
exit 1
fi
exit 0

View File

@ -10,7 +10,7 @@ USE_GDB=0
CLEAN_BUILD=0
# parse options. Thanks to http://wiki.bash-hackers.org/howto/getopts_tutorial
while getopts ":I:" opt; do
while getopts ":I:VGc" opt; do
case $opt in
I)
INSTANCE=$OPTARG
@ -64,8 +64,10 @@ make sitl -j4 || {
cmd="/tmp/ArduPlane.build/ArduPlane.elf -I$INSTANCE"
if [ $USE_VALGRIND == 1 ]; then
$autotest/run_in_terminal_window.sh "ardupilot (valgrind)" valgrind -q $cmd || exit 1
echo "Using valgrind"
$autotest/run_in_terminal_window.sh "ardupilot (valgrind)" valgrind $cmd || exit 1
elif [ $USE_GDB == 1 ]; then
echo "Using gdb"
tfile=$(mktemp)
echo r > $tfile
$autotest/run_in_terminal_window.sh "ardupilot (gdb)" gdb -x $tfile --args $cmd || exit 1