Changeset 89843 in webkit
- Timestamp:
- Jun 27, 2011 11:47:44 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r89841 r89843 1 2011-06-27 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 webkitpy should understand crash logs 6 https://bugs.webkit.org/show_bug.cgi?id=63468 7 8 We're planning to use this functionality to upload crash logs along 9 with test results for new-run-webkit-tests. 10 11 * Scripts/webkitpy/common/system/crashlog.py: Added. 12 * Scripts/webkitpy/common/system/crashlog_unittest.py: Added. 13 * Scripts/webkitpy/common/system/executive.py: 14 * Scripts/webkitpy/common/system/executive_unittest.py: 15 * Scripts/webkitpy/common/system/filesystem.py: 16 * Scripts/webkitpy/common/system/filesystem_mock.py: 17 * Scripts/webkitpy/tool/commands/queries.py: 18 1 19 2011-06-27 Adam Roben <aroben@apple.com> 2 20 -
trunk/Tools/Scripts/webkitpy/common/system/executive.py
r89412 r89843 290 290 assert(False) 291 291 292 def running_pids(self, process_name_filter=None): 293 if not process_name_filter: 294 process_name_filter = lambda process_name: True 295 296 running_pids = [] 297 298 if sys.platform in ("win32", "cygwin"): 299 raise NotImplemented() 300 301 ps_process = self.popen(['ps', '-eo', 'pid,comm'], stdout=self.PIPE, stderr=self.PIPE) 302 stdout, _ = ps_process.communicate() 303 for line in stdout.splitlines(): 304 try: 305 pid, process_name = line.split(' ', 1) 306 if process_name_filter(process_name): 307 running_pids.append(int(pid)) 308 except ValueError, e: 309 pass 310 311 return sorted(running_pids) 312 313 def wait_newest(self, process_name_filter=None): 314 if not process_name_filter: 315 process_name_filter = lambda process_name: True 316 317 running_pids = self.running_pids(process_name_filter) 318 if not running_pids: 319 return 320 pid = running_pids[-1] 321 322 while self.check_running_pid(pid): 323 time.sleep(0.25) 324 292 325 def _windows_image_name(self, process_name): 293 326 name, extension = os.path.splitext(process_name) -
trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py
r83015 r89843 200 200 # Maximum pid number on Linux is 32768 by default 201 201 self.assertFalse(executive.check_running_pid(100000)) 202 203 def test_running_pids(self): 204 if sys.platform in ("win32", "cygwin"): 205 return # This function isn't implemented on Windows yet. 206 207 executive = Executive() 208 pids = executive.running_pids() 209 self.assertTrue(os.getpid() in pids) -
trunk/Tools/Scripts/webkitpy/common/system/filesystem.py
r89206 r89843 58 58 return os.path.abspath(path) 59 59 60 def expanduser(self, path): 61 return os.path.expanduser(path) 62 60 63 def basename(self, path): 61 """Wraps os.path.basename()."""62 64 return os.path.basename(path) 63 65 64 66 def chdir(self, path): 65 """Wraps os.chdir()."""66 67 return os.chdir(path) 67 68 -
trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
r89206 r89843 71 71 return self._split(path)[1] 72 72 73 def expanduser(self, path): 74 if path[0] != "~": 75 return path 76 parts = path.split(self.sep, 1) 77 home_directory = self.sep + "Users" + self.sep + "mock" 78 if len(parts) == 1: 79 return home_directory 80 return home_directory + self.sep + parts[1] 81 73 82 def chdir(self, path): 74 83 path = self.normpath(path) -
trunk/Tools/Scripts/webkitpy/tool/commands/queries.py
r77913 r89843 37 37 from webkitpy.common.net.buildbot import BuildBot 38 38 from webkitpy.common.net.regressionwindow import RegressionWindow 39 from webkitpy.common.system.crashlogs import CrashLogs 39 40 from webkitpy.common.system.user import User 40 41 from webkitpy.tool.grammar import pluralize … … 42 43 from webkitpy.common.system.deprecated_logging import log 43 44 from webkitpy.layout_tests import port 44 45 45 46 46 class SuggestReviewers(AbstractDeclarativeCommand): … … 369 369 370 370 371 class CrashLog(AbstractDeclarativeCommand): 372 name = "crash-log" 373 argument_names = "PROCESS_NAME" 374 375 def execute(self, options, args, tool): 376 crash_logs = CrashLogs(tool.executive, tool.filesystem) 377 print crash_logs.find_newest_log(args[0]) 378 379 371 380 class SkippedPorts(AbstractDeclarativeCommand): 372 381 name = "skipped-ports"
Note: See TracChangeset
for help on using the changeset viewer.