aboutsummaryrefslogtreecommitdiff
path: root/test-rig/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test-rig/run.sh')
-rwxr-xr-xtest-rig/run.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/test-rig/run.sh b/test-rig/run.sh
new file mode 100755
index 0000000..ff63c21
--- /dev/null
+++ b/test-rig/run.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# In-container orchestrator. Called by ./test from outside.
+# /work/test-rig/run.sh unit|e2e|all
+#
+# Expects to run inside the scrcpy-android-test docker image with
+# /work mounted at the project root.
+
+set -eu
+
+cmd="${1:-unit}"
+
+mkdir -p /work/.tools/home /work/.tools/gradle-home /work/.tools/avd
+export HOME="/work/.tools/home"
+export GRADLE_USER_HOME="/work/.tools/gradle-home"
+export ANDROID_AVD_HOME="/work/.tools/avd"
+
+unit() {
+ echo "test: gradle :app:test"
+ /work/gradlew --no-daemon -q :app:test
+}
+
+e2e() {
+ /work/test-rig/e2e.sh
+}
+
+case "$cmd" in
+ unit) unit ;;
+ e2e) e2e ;;
+ all) unit && e2e ;;
+ record) /work/test-rig/record.sh ;;
+ apk) /work/test-rig/build-apk.sh ;;
+ *) echo "run.sh: bad cmd $cmd" >&2; exit 2 ;;
+esac