Bug 988849 - Add mach target for jit tests; r=gps
authorDan Minor <dminor@mozilla.com>
Thu, 27 Mar 2014 10:16:14 -0400
changeset 182886 12fbb6719ce94fed90c0a3ffccc887f5818e8353
parent 182885 0539570fb726e090c93177ea7be1ad9bd3d18714
child 182887 d2c541609d892f9c18aa79a069ee365c9557d9f8
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-esr52@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs988849
milestone31.0a1
Bug 988849 - Add mach target for jit tests; r=gps
testing/mach_commands.py
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -57,16 +57,21 @@ TEST_SUITES = {
         'mach_command': 'crashtest-ipc',
         'kwargs': {'test_file': None},
     },
     'jetpack': {
         'aliases': ('J',),
         'mach_command': 'jetpack-test',
         'kwargs': {},
     },
+    'jittest': {
+        'aliases': ('Jit', 'jit'),
+        'mach_command': 'jittest',
+        'kwargs': {'test_file': None},
+    },
     'mochitest-a11y': {
         'mach_command': 'mochitest-a11y',
         'kwargs': {'test_file': None},
     },
     'mochitest-browser': {
         'aliases': ('bc', 'BC', 'Bc'),
         'mach_command': 'mochitest-browser',
         'kwargs': {'test_file': None},
@@ -199,8 +204,29 @@ class MachCommands(MachCommandBase):
             result = tester.run_tests(progs, self.bindir, symbols_path)
         except Exception, e:
             self.log(logging.ERROR, 'cppunittests',
                 {'exception': str(e)},
                 'Caught exception running cpp unit tests: {exception}')
             result = False
 
         return 0 if result else 1
+
+@CommandProvider
+class JittestCommand(MachCommandBase):
+    @Command('jittest', category='testing', description='Run jit-test tests.')
+    @CommandArgument('--valgrind', action='store_true', help='Run jit-test suite with valgrind flag')
+
+    def run_jittest(self, **params):
+        import subprocess
+        import sys
+
+        if sys.platform.startswith('win'):
+            js = os.path.join(self.bindir, 'js.exe')
+        else:
+            js = os.path.join(self.bindir, 'js')
+        cmd = [os.path.join(self.topsrcdir, 'js', 'src', 'jit-test', 'jit_test.py'),
+              js, '--no-slow', '--no-progress', '--tinderbox', '--tbpl']
+
+        if params['valgrind']:
+            cmd.append('--valgrind')
+
+        return subprocess.call(cmd)