Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: scripts/slave/ios/test_runner.py

Issue 2142243003: Add support for new iossim in Xcode 8. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/ios/test_runner.py
diff --git a/scripts/slave/ios/test_runner.py b/scripts/slave/ios/test_runner.py
index c4aef8e7773b2b9fed561e880efa88df5f9303f2..b1603b00e012d3129681b4090374212a7abab6df 100755
--- a/scripts/slave/ios/test_runner.py
+++ b/scripts/slave/ios/test_runner.py
@@ -487,6 +487,7 @@ class SimulatorTestRunner(TestRunner):
self.timeout = '120'
self.homedir = ''
self.start_time = None
+ self.xcode_version = xcode_version
smut 2016/07/12 23:58:59 Can probably set this in the base class.
justincohen 2016/07/14 19:59:50 Done.
def SetStartTime(self):
"""Sets the start time, for finding crash reports during this run."""
@@ -496,13 +497,26 @@ class SimulatorTestRunner(TestRunner):
def CreateNewHomeDirectory(self):
"""Creates a new home directory for the simulator."""
- self.homedir = tempfile.mkdtemp()
+ if self.xcode_version == '8.0':
+ cmd = [
+ self.iossim_path,
+ '-d', self.platform,
+ '-s', self.version,
+ '-p'
+ ]
smut 2016/07/12 23:58:59 Can we use -w to wipe the simulator here, so that
justincohen 2016/07/14 19:59:50 See below.
smut 2016/07/14 21:25:54 I think it should wipe here as well. This call tha
justincohen 2016/07/14 22:24:32 Wipe is very fast, this SGTM, done.
+ self.homedir = subprocess.check_output(cmd)
+ else:
+ self.homedir = tempfile.mkdtemp()
+
def RemoveHomeDirectory(self):
"""Recursively removes the home directory being used by the simulator."""
- if os.path.exists(self.homedir):
- shutil.rmtree(self.homedir, ignore_errors=True)
+ if self.xcode_version == '8.0':
self.homedir = ''
smut 2016/07/12 23:58:59 I think it should shutil.rmtree even on Xcode 8 so
justincohen 2016/07/14 19:59:50 Xcode seems to freak out. How about we just call
smut 2016/07/14 21:25:54 Ok seems fine. -w should wipe the installed app an
justincohen 2016/07/14 22:24:32 yes/
+ else:
+ if os.path.exists(self.homedir):
+ shutil.rmtree(self.homedir, ignore_errors=True)
+ self.homedir = ''
def KillSimulators(self):
"""Forcibly kills any running iOS simulator instances."""
@@ -682,11 +696,18 @@ class SimulatorTestRunner(TestRunner):
self.iossim_path,
'-d', self.platform,
'-s', self.version,
- '-t', self.timeout,
- '-u', self.homedir,
]
+
args = []
+ if self.xcode_version == '8.0':
+ cmd.extend(['-w'])
smut 2016/07/12 23:58:59 I don't think it should include -w here. GetLaunch
justincohen 2016/07/14 19:59:50 Removed.
+ else:
+ cmd.extend([
+ '-t', self.timeout,
+ '-u', self.homedir
+ ])
+
if test_filter is not None:
kif_filter = self.GetKIFTestFilter(test_filter, blacklist)
gtest_filter = self.GetGTestFilter(test_filter, blacklist)
@@ -694,7 +715,13 @@ class SimulatorTestRunner(TestRunner):
cmd.extend([
'-e', 'GKIF_SCENARIO_FILTER=%s' % kif_filter,
])
- args.append('--gtest_filter=%s' % gtest_filter)
+
+ if self.xcode_version == '8.0':
+ cmd.extend([
+ '-c', '--gtest_filter=%s' % gtest_filter,
+ ])
+ else:
+ args.append('--gtest_filter=%s' % gtest_filter)
cmd.append(self.app_path)
cmd.extend(self.test_args)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698