File: test_loop.sh

package info (click to toggle)
ompl 1.1.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 37,164 kB
  • ctags: 8,045
  • sloc: cpp: 55,692; python: 3,843; sh: 147; makefile: 60
file content (51 lines) | stat: -rwxr-xr-x 847 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash

control_c()
# run if user hits control-c
{
  echo -en "\n*** User requested termination ***\n"
  exit 1
}

# This script simply runs a test many times in gdb
TEST_EXE=../build/bin/test_2denvs_geometric

COUNT=100
if [ $# -gt 0 ]
then
    COUNT=$1
fi

USE_GDB=false
if [ $# -gt 1 ]
then
    USE_GDB=true
    echo "Using gdb."
fi

ulimit -c unlimited

trap control_c SIGINT
rm -f ompl_run_test_codes

for i in $(seq $COUNT)
do
    echo "Running test $i of $COUNT" > ompl_run_test_count
    if $USE_GDB ; then
	gdb --return-child-result --batch --ex run --args $TEST_EXE
    else
	$TEST_EXE
    fi
    RET_CODE=$?
    echo $RET_CODE >> ompl_run_test_codes
    if [ $RET_CODE -ne 0 ]
    then
        echo "Error found!"
	if [ -e core ]
	then
	    echo "Renaming core file."
	    mv core core.$i
	fi
    fi
done
rm -f ompl_run_test_count