From 0e47d6202426bc400c6a1cb670659c847bc3ba43 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 27 Jun 2014 17:06:18 -0400 Subject: [PATCH 1/2] tests: by default, run on included urzip.apk This means you can just do `cd tests/ && ./run-tests` to run the tests now. You can still override the APK source with the first argument, like: cd tests/ && ./run-tests /path/to/lots/of/apks/dir --- MANIFEST.in | 1 + tests/run-tests | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 93c086ab..29dd42e4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -28,6 +28,7 @@ include fdroidserver/getsig/run.sh include fdroidserver/getsig/make.sh include fdroidserver/getsig/getsig.java include tests/run-tests +include tests/urzip.apk include wp-fdroid/AndroidManifest.xml include wp-fdroid/android-permissions.php include wp-fdroid/readme.txt diff --git a/tests/run-tests b/tests/run-tests index a5576765..5bc1bd7b 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -42,7 +42,8 @@ create_test_file() { #------------------------------------------------------------------------------# # "main" -if [ $# -ne 1 ]; then +if [ $1 = "-h" ] || [ $1 = "--help" ]; then + set +x echo "Usage: $0 '/path/to/folder/with/apks'" exit 1 fi @@ -53,7 +54,11 @@ if [ -z $ANDROID_HOME ]; then exit 1 fi -APKDIR=$1 +if [ -z $1 ]; then + APKDIR=`pwd` +else + APKDIR=$1 +fi if [ -z $WORKSPACE ]; then WORKSPACE=`dirname $(pwd)` From 25a94dced21d92b4f5e0094257620b70fddafc24 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 27 Jun 2014 17:06:52 -0400 Subject: [PATCH 2/2] tests: create a source tarball and use that to build a repo This tests that setup.py is in working order and creating a functional source tarball. --- tests/run-tests | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/run-tests b/tests/run-tests index 5bc1bd7b..a3b5e76b 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -75,6 +75,24 @@ if [ -z $aapt ]; then aapt=`ls -1 $ANDROID_HOME/build-tools/*/aapt | sort | tail -1` fi + +#------------------------------------------------------------------------------# +echo_header "create a source tarball and use that to build a repo" + +cd $WORKSPACE +python setup.py sdist + +REPOROOT=`create_test_dir` +cd $REPOROOT +tar xzf `ls -1 $WORKSPACE/dist/fdroidserver-*.tar.gz | sort -n | tail -1` +cd $REPOROOT/fdroidserver-*/fdroidserver/getsig +./make.sh +cd $REPOROOT +./fdroidserver-*/fdroid init +copy_apks_into_repo $REPOROOT +./fdroidserver-*/fdroid update --create-metadata + + #------------------------------------------------------------------------------# echo_header "test config checks of local_copy_dir"