add script to do a test run of creating a new repo

This tests/ folder can then be used for all sorts of tests, including
standard python tests.
This commit is contained in:
Hans-Christoph Steiner 2014-04-01 16:16:24 -04:00
parent 434eab6606
commit bfa21fb630
1 changed files with 34 additions and 0 deletions

34
tests/run-tests.sh Executable file
View File

@ -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