chiark / gitweb /
add script to do a test run of creating a new repo
authorHans-Christoph Steiner <hans@eds.org>
Tue, 1 Apr 2014 20:16:24 +0000 (16:16 -0400)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 2 Apr 2014 21:49:07 +0000 (17:49 -0400)
This tests/ folder can then be used for all sorts of tests, including
standard python tests.

tests/run-tests.sh [new file with mode: 0755]

diff --git a/tests/run-tests.sh b/tests/run-tests.sh
new file mode 100755 (executable)
index 0000000..5c5c31d
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+set -x
+
+if [ -z $WORKSPACE ]; then
+    WORKSPACE=`dirname $(pwd)`
+    echo "Setting Workspace to $WORKSPACE"
+fi
+
+# allow the location of the script to be overridden
+if [ -z $fdroid ]; then
+    fdroid="$WORKSPACE/fdroid"
+fi
+
+#------------------------------------------------------------------------------#
+# setup a new repo from scratch
+
+REPOROOT=`mktemp --directory --tmpdir=$WORKSPACE`
+cd $REPOROOT
+$fdroid init
+for f in `ls -1 ../../*/bin/*.apk`; do
+    name=$(basename $(dirname `dirname $f`))
+    echo "name $name"
+    apk=${name}_`basename $f`
+    echo "apk $apk"
+    cp $f $REPOROOT/repo/$apk
+done
+# delete any 'unaligned' duplicates
+rm -f $REPOROOT/repo/*unaligned*.apk
+
+
+$fdroid update -c
+$fdroid update