Bug 1348114 - Use correct default path for Robocop APK when building with Gradle. r?nalexander
./mach robocop calls through to mochitest_options.py to validate the passed command line options, so it's not necessary to define a default Robocop APK path from two different places.
MozReview-Commit-ID: 8CryDqOKDBF
--- a/testing/mochitest/mach_commands.py
+++ b/testing/mochitest/mach_commands.py
@@ -427,21 +427,16 @@ class RobocopCommands(MachCommandBase):
def run_robocop(self, serve=False, **kwargs):
if serve:
kwargs['autorun'] = False
if not kwargs.get('robocopIni'):
kwargs['robocopIni'] = os.path.join(self.topobjdir, '_tests', 'testing',
'mochitest', 'robocop.ini')
- if not kwargs.get('robocopApk'):
- kwargs['robocopApk'] = os.path.join(self.topobjdir, 'mobile', 'android',
- 'tests', 'browser', 'robocop',
- 'robocop-debug.apk')
-
from mozbuild.controller.building import BuildDriver
self._ensure_state_subdir_exists('.')
test_paths = kwargs['test_paths']
kwargs['test_paths'] = []
from mozbuild.testing import TestResolver
resolver = self._spawn(TestResolver)
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -1021,19 +1021,25 @@ class AndroidArguments(ArgumentContainer
if options.robocopIni != "":
if not os.path.exists(options.robocopIni):
parser.error(
"Unable to find specified robocop .ini manifest '%s'" %
options.robocopIni)
options.robocopIni = os.path.abspath(options.robocopIni)
if not options.robocopApk and build_obj:
- options.robocopApk = os.path.join(build_obj.topobjdir, 'mobile', 'android',
- 'tests', 'browser',
- 'robocop', 'robocop-debug.apk')
+ if build_obj.substs.get('MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE'):
+ options.robocopApk = os.path.join(build_obj.topobjdir, 'gradle', 'build',
+ 'mobile', 'android', 'app', 'outputs', 'apk',
+ 'app-automation-debug-androidTest-'
+ 'unaligned.apk')
+ else:
+ options.robocopApk = os.path.join(build_obj.topobjdir, 'mobile', 'android',
+ 'tests', 'browser',
+ 'robocop', 'robocop-debug.apk')
if options.robocopApk != "":
if not os.path.exists(options.robocopApk):
parser.error(
"Unable to find robocop APK '%s'" %
options.robocopApk)
options.robocopApk = os.path.abspath(options.robocopApk)