#!/bin/bash
DATESTAMP=`date +%Y%m%d`-`date +%H%M%S`
LOGDIR="/home/alan/tests/$DATESTAMP"
KRILLIN=(com.ubuntu.clock com.ubuntu.music com.ubuntu.weather com.ubuntu.reminders com.ubuntu.calculator)
FLO=(com.ubuntu.weather com.ubuntu.reminders com.ubuntu.calculator com.ubuntu.terminal com.ubuntu.sudoku com.ubuntu.shorts com.ubuntu.dropping-letters com.ubuntu.music com.ubuntu.filemanager com.ubuntu.clock)
NEXUS7=0583a679
ONEOFF=(com.ubuntu.sudoku)
mkdir -p $LOGDIR
## Change these two line to select what to test
#TESTING=${FLO[@]}
TESTING=$ONEOFF
DEVICE=$NEXUS7
echo $TESTING
echo $DEVICE
for i in ${TESTING[@]}; do
echo "== Starting $i"
mkdir -p $LOGDIR/$i
echo "Command: adt-run --setup-commands 'apt-get update' --click $i --summary-file $LOGDIR/$i/summary_$i -l $LOGDIR/$i/debug_$i.log -o $LOGDIR/$i --- ssh -s adb -- -s $DEVICE"
adt-run --setup-commands 'apt-get update' --click $i --summary-file $LOGDIR/$i/summary_$i -l $LOGDIR/$i/debug_$i.log -o $LOGDIR/$i --- ssh -s adb -- -s $DEVICE
echo "trv $LOGDIR/$i/artifacts/autopilot.subunit" >> $LOGDIR/summary.txt
echo "== Ended $i"
done
echo "Results in $LOGDIR"
for f in $(find $LOGDIR -name 'summary_*'); do
echo -n $f
cat $f
done
cat $LOGDIR/summary.txt