Bug 1235559 - |mach android-emulator| looks for the wrong file names on Windows. r=gbrown
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Tue, 29 Dec 2015 06:25:00 +0100
changeset 277871 2f14aeae6e06a397d48f80f76608843a099771b7
parent 277870 426164db47c6e9e7bd5216efcbe5743606f1c12b
child 277872 189cbfa99950a419e8be5a38489793ca5b9b641c
push id69628
push usercbook@mozilla.com
push dateWed, 30 Dec 2015 11:16:09 +0000
treeherdermozilla-inbound@b493cf33851f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1235559
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1235559 - |mach android-emulator| looks for the wrong file names on Windows. r=gbrown
testing/mozbase/mozrunner/mozrunner/devices/android_device.py
--- a/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
+++ b/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
@@ -577,16 +577,21 @@ def _find_sdk_exe(substs, exe, tools):
             if os.path.exists(exe_path):
                 found = True
             else:
                 _log_debug(
                     "Unable to find executable at %s" % exe_path)
         except KeyError:
             _log_debug("%s not set" % exe.upper())
 
+    # Append '.exe' to the name on Windows if it's not present,
+    # so that the executable can be found.
+    if (os.name == 'nt' and not exe.lower().endswith('.exe')):
+        exe += '.exe'
+
     if not found:
         # Can exe be found in the Android SDK?
         try:
             android_sdk_root = os.environ['ANDROID_SDK_ROOT']
             exe_path = os.path.join(
                 android_sdk_root, subdir, exe)
             if os.path.exists(exe_path):
                 found = True