|
32 | 32 | import logging |
33 | 33 | import optparse |
34 | 34 | import os |
| 35 | +import resource |
35 | 36 | import traceback |
36 | 37 |
|
37 | 38 | from webkitpy.common.host import Host |
@@ -309,6 +310,7 @@ def parse_args(args): |
309 | 310 | optparse.make_option('--display-server', choices=['xvfb', 'xorg', 'weston', 'wayland'], default='xvfb', |
310 | 311 | help='"xvfb": Use a virtualized X11 server. "xorg": Use the current X11 session. ' |
311 | 312 | '"weston": Use a virtualized Weston server. "wayland": Use the current wayland session.'), |
| 313 | + optparse.make_option('--enable-core-dumps-nolimit', action='store_true', default=False, help='Enable core dumps for the test run (runs the equivalent of "ulimit -c unlimited" before starting the tests).'), |
312 | 314 | optparse.make_option("--world-leaks", action="store_true", default=False, help="Check for world leaks (currently, only documents). Differs from --leaks in that this uses internal instrumentation, rather than external tools."), |
313 | 315 | optparse.make_option("--accessibility-isolated-tree", action="store_true", default=False, help="Runs tests in accessibility isolated tree mode."), |
314 | 316 | optparse.make_option("--allowed-host", type="string", action="append", default=[], help="If specified, tests are allowed to make requests to the specified hostname."), |
@@ -488,6 +490,13 @@ def run(port, options, args, logging_stream): |
488 | 490 | try: |
489 | 491 | printer = printing.Printer(port, options, logging_stream, logger=logger) |
490 | 492 |
|
| 493 | + if options.enable_core_dumps_nolimit: |
| 494 | + try: |
| 495 | + resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY)) |
| 496 | + _log.debug('Enabled coredumps for test run') |
| 497 | + except (ValueError, OSError) as e: |
| 498 | + _log.error('Failed to enable coredumps: %s' % str(e)) |
| 499 | + |
491 | 500 | _set_up_derived_options(port, options) |
492 | 501 | manager = Manager(port, options, printer) |
493 | 502 | printer.print_config(port.results_directory()) |
|
0 commit comments