Merge branch 'test-updates-and-related-bug-fixes' into 'master'

Test updates and related bug fixes

I just set up some big tests of generating repos based on feeding as many random APKs into `fdroid update` as possible.  On our jenkins server, the tests copy all of the APKs that the jenkins server has generated and builds a repo from them.  This process caught lots of little glitches in the whole process.  While these little glitches are usually caused by problematic APKs, `fdroid update` should handle them gracefully.  Hopefully this set of fixes accomplishes that.
This commit is contained in:
Ciaran Gultnieks 2014-06-05 15:51:24 +00:00
commit b86bfb94fb
8 changed files with 166 additions and 60 deletions

View file

@ -144,6 +144,23 @@ def test_sdk_exists(c):
return True
def test_build_tools_exists(c):
if not test_sdk_exists(c):
return False
build_tools = os.path.join(c['sdk_path'], 'build-tools')
versioned_build_tools = os.path.join(build_tools, c['build_tools'])
if not os.path.isdir(versioned_build_tools):
logging.critical('Android Build Tools path "'
+ versioned_build_tools + '" does not exist!')
return False
if not os.path.exists(os.path.join(c['sdk_path'], 'build-tools', c['build_tools'], 'aapt')):
logging.critical('Android Build Tools "'
+ versioned_build_tools
+ '" does not contain "aapt"!')
return False
return True
def write_password_file(pwtype, password=None):
'''
writes out passwords to a protected file instead of passing passwords as
@ -1514,7 +1531,7 @@ def SilentPopen(commands, cwd=None, shell=False):
return FDroidPopen(commands, cwd=cwd, shell=shell, output=False)
def FDroidPopen(commands, cwd=None, shell=False, output=True):
def FDroidPopen(commands, cwd=None, shell=False, output=False):
"""
Run a command and capture the possibly huge output.
@ -1541,7 +1558,7 @@ def FDroidPopen(commands, cwd=None, shell=False, output=True):
while not stdout_reader.eof():
while not stdout_queue.empty():
line = stdout_queue.get()
if output and options.verbose:
if output or options.verbose:
# Output directly to console
sys.stdout.write(line)
sys.stdout.flush()