chiark / gitweb /
fix tests to work when only Debian Android SDK is installed
authorHans-Christoph Steiner <hans@eds.org>
Wed, 8 Nov 2017 12:51:03 +0000 (13:51 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 8 Nov 2017 13:05:17 +0000 (14:05 +0100)
jenkins.debian.net only had `apt install android-sdk`, it does not have any
of Google's packages installed.

tests/common.TestCase

index ecd16a8d7abafebb27179b65494a11385293f843..a5d52f75eccf6a77b4387b0cfa4796b92030bdf3 100755 (executable)
@@ -70,7 +70,10 @@ class CommonTest(unittest.TestCase):
             return False
 
     def _find_all(self):
-        for cmd in ('aapt', 'adb', 'android', 'zipalign'):
+        tools = ['aapt', 'adb', 'zipalign']
+        if os.path.exists(os.path.join(os.getenv('ANDROID_HOME'), 'tools', 'android')):
+            tools.append('android')
+        for cmd in tools:
             path = fdroidserver.common.find_sdk_tools_cmd(cmd)
             if path is not None:
                 self.assertTrue(os.path.exists(path))