AutoTest: add -j option to sim_vehicle

new option controls the number of processors used during compile
This commit is contained in:
Randy Mackay 2014-05-21 21:13:06 +09:00
parent 7cc3cb8d9b
commit 5e21111076
1 changed files with 10 additions and 5 deletions

View File

@ -6,6 +6,7 @@ TRACKER_LOCATION="CMAC_PILOTSBOX"
VEHICLE="" VEHICLE=""
BUILD_TARGET="sitl" BUILD_TARGET="sitl"
FRAME="" FRAME=""
NUM_PROCS=1
# check the instance number to allow for multiple copies of the sim running at once # check the instance number to allow for multiple copies of the sim running at once
INSTANCE=0 INSTANCE=0
@ -35,6 +36,7 @@ Options:
-f FRAME set aircraft frame type -f FRAME set aircraft frame type
for copters can choose +, X, quad or octa for copters can choose +, X, quad or octa
for planes can choose elevon or vtail for planes can choose elevon or vtail
-j NUM_PROC number of processors to use during build (default 1)
mavproxy_options: mavproxy_options:
--map start with a map --map start with a map
@ -51,7 +53,7 @@ EOF
# parse options. Thanks to http://wiki.bash-hackers.org/howto/getopts_tutorial # parse options. Thanks to http://wiki.bash-hackers.org/howto/getopts_tutorial
while getopts ":I:VgGcTL:v:hwf:" opt; do while getopts ":I:VgGcj:TL:v:hwf:" opt; do
case $opt in case $opt in
v) v)
VEHICLE=$OPTARG VEHICLE=$OPTARG
@ -84,6 +86,9 @@ while getopts ":I:VgGcTL:v:hwf:" opt; do
c) c)
CLEAN_BUILD=1 CLEAN_BUILD=1
;; ;;
j)
NUM_PROCS=$OPTARG
;;
w) w)
WIPE_EEPROM=1 WIPE_EEPROM=1
;; ;;
@ -178,9 +183,9 @@ pushd $autotest/../../$VEHICLE || {
if [ $CLEAN_BUILD == 1 ]; then if [ $CLEAN_BUILD == 1 ]; then
make clean make clean
fi fi
make $BUILD_TARGET -j4 || { make $BUILD_TARGET -j$NUM_PROCS || {
make clean make clean
make $BUILD_TARGET -j4 make $BUILD_TARGET -j$NUM_PROCS
} }
popd popd
@ -206,9 +211,9 @@ if [ $START_ANTENNA_TRACKER == 1 ]; then
if [ $CLEAN_BUILD == 1 ]; then if [ $CLEAN_BUILD == 1 ]; then
make clean make clean
fi fi
make sitl -j4 || { make sitl -j$NUM_PROCS || {
make clean make clean
make sitl -j4 make sitl -j$NUM_PROCS
} }
TRACKER_INSTANCE=1 TRACKER_INSTANCE=1
TRACKIN_PORT="127.0.0.1:"$((5502+10*$TRACKER_INSTANCE)) TRACKIN_PORT="127.0.0.1:"$((5502+10*$TRACKER_INSTANCE))