rust/src/etc/adb_run_wrapper.sh

37 lines
780 B
Bash
Raw Normal View History

2013-05-29 19:36:53 -05:00
#
# usage : adb_run_wrapper [test dir - where test executables exist] [test executable]
#
2013-06-13 16:59:34 -05:00
# Sometimes android shell produce exitcode "1 : Text File Busy"
# Retry after $WAIT seconds, expecting resource cleaned-up
WAIT=10
2013-05-29 19:36:53 -05:00
PATH=$1
if [ -d "$PATH" ]
2013-05-29 02:04:11 -05:00
then
shift
2013-05-29 19:36:53 -05:00
RUN=$1
2013-05-29 02:04:11 -05:00
2013-05-29 19:36:53 -05:00
if [ ! -z "$RUN" ]
then
shift
L_RET=1
L_COUNT=0
cd $PATH
while [ $L_RET -eq 1 ]
2013-05-29 19:36:53 -05:00
do
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
2013-06-13 16:59:34 -05:00
L_RET=$?
if [ $L_COUNT -gt 0 ]
then
/system/bin/sleep $WAIT
/system/bin/sync
fi
L_COUNT=$((L_COUNT+1))
2013-05-29 19:36:53 -05:00
done
2013-06-13 16:59:34 -05:00
echo $L_RET > $PATH/$RUN.exitcode
2013-05-29 19:36:53 -05:00
fi
fi