chiark / gitweb /
use utf-8 as default encoding for config.py
[fdroidserver.git] / tests / run-tests
index 7629f431bb107db1f5dd070ec4f7225c6d6f77ad..dfdda5ad01ff39f935c079d40a46a427cd9358bc 100755 (executable)
@@ -33,7 +33,7 @@ create_fake_android_home() {
 
 create_test_dir() {
     test -e $WORKSPACE/.testfiles || mkdir $WORKSPACE/.testfiles
-    TMPDIR=$WORKSPACE/.testfiles  mktemp -d
+    mktemp -d $WORKSPACE/.testfiles/run-tests.XXXX
 }
 
 create_test_file() {
@@ -115,7 +115,26 @@ $fdroid --version
 echo_header "build the TeX manual"
 
 cd $WORKSPACE/docs
-./gendocs.sh -o html --email admin@f-droid.org fdroid "F-Droid Server Manual"
+# this is only ever generated officially on GNU/Linux
+if [ `uname -s` == "Linux" ]; then
+    ./gendocs.sh -o html --email admin@f-droid.org fdroid "F-Droid Server Manual"
+fi
+
+
+#------------------------------------------------------------------------------#
+echo_header "test UTF-8 metadata"
+
+REPOROOT=`create_test_dir`
+cd $REPOROOT
+
+$fdroid init
+sed -i.tmp 's,^ *repo_description.*,repo_description = """获取已安装在您的设备上的应用的,' config.py
+mkdir metadata
+cp $WORKSPACE/tests/urzip.apk repo/
+cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.txt metadata/
+
+$fdroid readmeta
+$fdroid update
 
 
 #------------------------------------------------------------------------------#
@@ -503,7 +522,7 @@ test -e repo/index.jar
 grep -F '<application id=' repo/index.xml > /dev/null
 
 # now set fake repo_keyalias
-sed -i 's,^ *repo_keyalias.*,repo_keyalias = "fake",' $REPOROOT/config.py
+sed -i.tmp 's,^ *repo_keyalias.*,repo_keyalias = "fake",' $REPOROOT/config.py
 set +e
 $fdroid update
 if [ $? -eq 0 ]; then