Bug 1146156: Add RR support to js/src/tests/jstests.py. r=nbp
authorJim Blandy <jimb@mozilla.com>
Sat, 21 Mar 2015 17:34:45 -0700
changeset 265394 7a3189057b78fe75b3623f7b63e570f4bb6328c4
parent 265393 772945b1130d44087ad2009c3112cb69e307549e
child 265395 4a33e8c95cc934493dd142f391fd020ae8c89f9b
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1146156
milestone39.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 1146156: Add RR support to js/src/tests/jstests.py. r=nbp
js/src/tests/jstests.py
--- a/js/src/tests/jstests.py
+++ b/js/src/tests/jstests.py
@@ -105,16 +105,18 @@ def parse_args():
                           help='Run under JS debugger.')
     harness_og.add_option('--passthrough', action='store_true',
                           help='Run tests with stdin/stdout attached to'
                           ' caller.')
     harness_og.add_option('--valgrind', action='store_true',
                           help='Run tests in valgrind.')
     harness_og.add_option('--valgrind-args', default='',
                           help='Extra args to pass to valgrind.')
+    harness_og.add_option('--rr', action='store_true',
+                          help='Run tests under RR record-and-replay debugger.')
     op.add_option_group(harness_og)
 
     input_og = OptionGroup(op, "Inputs", "Change what tests are run.")
     input_og.add_option('-f', '--file', dest='test_file', action='append',
                         help='Get tests from the given file.')
     input_og.add_option('-x', '--exclude-file', action='append',
                         help='Exclude tests from the given file.')
     input_og.add_option('-d', '--exclude-random', dest='random',
@@ -169,27 +171,29 @@ def parse_args():
     if len(args) > 0:
         options.js_shell = abspath(args[0])
         requested_paths |= set(args[1:])
 
     # If we do not have a shell, we must be in a special mode.
     if options.js_shell is None and not options.make_manifests:
         op.error('missing JS_SHELL argument')
 
-    # Valgrind and gdb are mutually exclusive.
-    if options.valgrind and options.debug:
-        op.error("--valgrind and --debug are mutually exclusive.")
+    # Valgrind, gdb, and rr are mutually exclusive.
+    if sum(map(lambda e: 1 if e else 0, [options.valgrind, options.debug, options.rr])) > 1:
+        op.error("--valgrind, --debug, and --rr are mutually exclusive.")
 
     # Fill the debugger field, as needed.
     prefix = options.debugger.split() if options.debug else []
     if options.valgrind:
         prefix = ['valgrind'] + options.valgrind_args.split()
         if os.uname()[0] == 'Darwin':
             prefix.append('--dsymutil=yes')
         options.show_output = True
+    if options.rr:
+        prefix = ['rr', 'record']
 
     js_cmd_args = options.shell_args.split()
     if options.jorendb:
         options.passthrough = True
         options.hide_progress = True
         options.worker_count = 1
         debugger_path = realpath(os.path.join(
             abspath(dirname(abspath(__file__))),