diff --git a/build.conf.sample b/build.conf.sample index e33c9bb..87832b7 100644 --- a/build.conf.sample +++ b/build.conf.sample @@ -10,3 +10,5 @@ RELEASE_KEY= # The path to your Android SDK ANDROID_SDK= +# The AVD for running the unit and scenario tests +AVD_TEST= diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..b50c1c5 --- /dev/null +++ b/test.sh @@ -0,0 +1,35 @@ +### +# Run all unit and scenario tests +# +# TODO: +# - Build new version of Yaaic and Tests +# - Start device with -wipe-data +# - Deploy both APKs to device +# + +if [ ! -f build.conf ]; then + echo "Config file missing: build.conf" + echo "Modify the build.conf.sample file and save it as build.conf" + exit 1 +fi + +. build.conf + +echo "Starting emulator" +"$ANDROID_SDK"tools/emulator -avd "$AVD_TEST" & + +sleep 35 + +echo "Unlocking emulator" +echo "event send EV_KEY:KEY_MENU:1 EV_KEY:KEY_MENU:0" | telnet localhost 5554 + +sleep 5 + +echo "Running tests" +"$ANDROID_SDK"tools/adb -e shell "am instrument -w org.yaaic.test/android.test.InstrumentationTestRunner" + +sleep 3 + +echo "Killing emulator" +kill $(jobs -p) +