diff --git a/Tools/autotest/run_in_terminal_window.sh b/Tools/autotest/run_in_terminal_window.sh index 625551427a..0ff56be345 100755 --- a/Tools/autotest/run_in_terminal_window.sh +++ b/Tools/autotest/run_in_terminal_window.sh @@ -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 diff --git a/Tools/autotest/sim_arduplane.sh b/Tools/autotest/sim_arduplane.sh index 0594b4c52a..04deb50df7 100755 --- a/Tools/autotest/sim_arduplane.sh +++ b/Tools/autotest/sim_arduplane.sh @@ -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