def test_generate_crash_log(self): generator = GDBCrashLogGenerator('DumpRenderTree', 28529, newer_than=None, filesystem=MockFileSystem({'/path/to/coredumps': ''}), path_to_driver=None) core_directory = os.environ.get('WEBKIT_CORE_DUMPS_DIRECTORY', '/path/to/coredumps') core_pattern = os.path.join(core_directory, "core-pid_%p-_-process_%e") mock_empty_crash_log = """\ crash log for DumpRenderTree (pid 28529): Coredump core-pid_28529-_-process_DumpRenderTree not found. To enable crash logs: - run this command as super-user: echo "%(core_pattern)s" > /proc/sys/kernel/core_pattern - enable core dumps: ulimit -c unlimited - set the WEBKIT_CORE_DUMPS_DIRECTORY environment variable: export WEBKIT_CORE_DUMPS_DIRECTORY=%(core_directory)s STDERR: <empty>""" % locals() def _mock_gdb_output(self, coredump_path): return (mock_empty_crash_log, []) generator._get_gdb_output = _mock_gdb_output stderr, log = generator.generate_crash_log(None, None) self.assertEqual(stderr, None) self.assertMultiLineEqual(log, mock_empty_crash_log) generator.newer_than = 0.0 self.assertEqual(stderr, None) self.assertMultiLineEqual(log, mock_empty_crash_log)
def test_generate_crash_log(self): generator = GDBCrashLogGenerator('DumpRenderTree', 28529, newer_than=None, filesystem=MockFileSystem({'/path/to/coredumps': ''}), path_to_driver=None) core_directory = os.environ.get('WEBKIT_CORE_DUMPS_DIRECTORY', '/path/to/coredumps') core_pattern = os.path.join(core_directory, "core-pid_%p-_-process_%E") mock_empty_crash_log = """\ crash log for DumpRenderTree (pid 28529): Coredump core-pid_28529-_-process_DumpRenderTree not found. To enable crash logs: - run this command as super-user: echo "%(core_pattern)s" > /proc/sys/kernel/core_pattern - enable core dumps: ulimit -c unlimited - set the WEBKIT_CORE_DUMPS_DIRECTORY environment variable: export WEBKIT_CORE_DUMPS_DIRECTORY=%(core_directory)s STDERR: <empty>""" % locals() def _mock_gdb_output(self, coredump_path): return (mock_empty_crash_log, []) generator._get_gdb_output = _mock_gdb_output stderr, log = generator.generate_crash_log(None, None) self.assertEqual(stderr, None) self.assertMultiLineEqual(log, mock_empty_crash_log) generator.newer_than = 0.0 self.assertEqual(stderr, None) self.assertMultiLineEqual(log, mock_empty_crash_log)
def test_generate_crash_log(self): if sys.platform.startswith('win'): return executive = MockExecutive() executive._proc = MockProcess() executive._proc.stdout = 'STDERR: <empty>' generator = GDBCrashLogGenerator(executive, 'DumpRenderTree', 28529, newer_than=None, filesystem=MockFileSystem( {'/path/to/coredumps': ''}), path_to_driver=None, port_name="gtk", configuration="Debug") core_directory = os.environ.get('WEBKIT_CORE_DUMPS_DIRECTORY', '/path/to/coredumps') core_pattern = generator._filesystem.join(core_directory, "core-pid_%p.dump") mock_empty_crash_log = """\ crash log for DumpRenderTree (pid 28529): Coredump core-pid_28529.dump not found. To enable crash logs: - run this command as super-user: echo "%(core_pattern)s" > /proc/sys/kernel/core_pattern - enable core dumps: ulimit -c unlimited - set the WEBKIT_CORE_DUMPS_DIRECTORY environment variable: export WEBKIT_CORE_DUMPS_DIRECTORY=%(core_directory)s STDERR: <empty>""" % locals() def _mock_gdb_output(self, coredump_path): return (mock_empty_crash_log, []) generator._get_gdb_output = _mock_gdb_output stderr, log = generator.generate_crash_log(None, None) self.assertEqual(stderr, None) self.assertMultiLineEqual(log, mock_empty_crash_log) generator.newer_than = 0.0 self.assertEqual(stderr, None) self.assertMultiLineEqual(log, mock_empty_crash_log)
def _get_crash_log(self, name, pid, stdout, stderr, newer_than, target_host=None): return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self._path_to_driver).generate_crash_log( stdout, stderr)
def test_generate_crash_log(self): if sys.platform.startswith("win"): return process_coredump_script_path = "/path/to/coredump-processor" generator = GDBCrashLogGenerator( "DumpRenderTree", 28529, newer_than=None, filesystem=MockFileSystem({"/path/to/coredumps": ""}), process_coredump_script_path=process_coredump_script_path, path_to_driver=None, ) core_directory = os.environ.get("WEBKIT_CORE_DUMPS_DIRECTORY", "/path/to/coredumps") core_pattern = "|%s %s/core-pid_%%p.dump" % (process_coredump_script_path, core_directory) mock_empty_crash_log = ( """\ crash log for DumpRenderTree (pid 28529): Coredump core-pid_28529.dump not found. To enable crash logs: - run this command as super-user: echo "%(core_pattern)s" > /proc/sys/kernel/core_pattern - enable core dumps: ulimit -c unlimited - set the WEBKIT_CORE_DUMPS_DIRECTORY environment variable: export WEBKIT_CORE_DUMPS_DIRECTORY=%(core_directory)s STDERR: <empty>""" % locals() ) def _mock_gdb_output(self, coredump_path): return (mock_empty_crash_log, []) generator._get_gdb_output = _mock_gdb_output stderr, log = generator.generate_crash_log(None, None) self.assertEqual(stderr, None) self.assertMultiLineEqual(log, mock_empty_crash_log) generator.newer_than = 0.0 self.assertEqual(stderr, None) self.assertMultiLineEqual(log, mock_empty_crash_log)
def _get_crash_log(self, name, pid, stdout, stderr, newer_than, target_host=None): name = "WPEWebProcess" if name == "WebProcess" else name return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self._path_to_driver).generate_crash_log( stdout, stderr)
def _get_crash_log(self, name, pid, stdout, stderr, newer_than, target_host=None): return GDBCrashLogGenerator( self._executive, name, pid, newer_than, self._filesystem, self._path_to_driver, self.port_name, self.get_option('configuration')).generate_crash_log( stdout, stderr)
def _get_crash_log(self, name, pid, stdout, stderr, newer_than): return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self.path_to_script("process-linux-coredump"), self._path_to_driver).generate_crash_log(stdout, stderr)