nrwt: clean up logging, part 1
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Aug 2012 18:31:44 +0000 (18:31 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Aug 2012 18:31:44 +0000 (18:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=93018

Reviewed by Ojan Vafai.

remove --print, --help-printing from nrwt, add three new options:
--quiet, which just logs warnings,errors, and unexpected results
--debug-rwt-logging, a new name for --verbose
--details, to get the old --print trace-everything behavior

This patch does not implement the new "one line per test"
--verbose behavior specified in bug 88702, and there's a bunch
of internal cleanup I can do in printing.py that I'll defer to
a later patch to make things easier to review.

This patch deletes a lot of unit tests that are no longer
necessary since there aren't so many logging combinations.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(run):
(main):
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(parse_args):
(passing_run):
(StreamTestingMixin.assertContains):
(MainTest.test_child_processes_2):
(MainTest.test_child_processes_min):
(MainTest.test_full_results_html):
(MainTest.test_no_tests_found):
(MainTest.test_no_tests_found_2):
(MainTest.test_repeat_each_iterations_num_tests):
(MainTest.test_additional_platform_directory):
(RebaselineTest.assertBaselines):
* Scripts/webkitpy/layout_tests/views/printing.py:
(print_options):
(Printer.__init__):
(Printer.enabled):
(Printer.print_unexpected_results):
* Scripts/webkitpy/layout_tests/views/printing_unittest.py:
(TestUtilityFunctions.test_print_options):
(Testprinter.get_result_summary):
(Testprinter.test_configure_and_cleanup):
(Testprinter.test_print_config):
(Testprinter.test_print_one_line_summary):
(Testprinter.test_print_unexpected_results):
(test_details):
(test_default):
(test_quiet):
(test_verbose):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124789 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
Tools/Scripts/webkitpy/layout_tests/views/printing.py
Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py

index be34d9c..0284648 100644 (file)
@@ -1,3 +1,55 @@
+2012-08-06  Dirk Pranke  <dpranke@chromium.org>
+
+        nrwt: clean up logging, part 1
+        https://bugs.webkit.org/show_bug.cgi?id=93018
+
+        Reviewed by Ojan Vafai.
+
+        remove --print, --help-printing from nrwt, add three new options:
+        --quiet, which just logs warnings,errors, and unexpected results
+        --debug-rwt-logging, a new name for --verbose
+        --details, to get the old --print trace-everything behavior
+
+        This patch does not implement the new "one line per test"
+        --verbose behavior specified in bug 88702, and there's a bunch
+        of internal cleanup I can do in printing.py that I'll defer to
+        a later patch to make things easier to review.
+
+        This patch deletes a lot of unit tests that are no longer
+        necessary since there aren't so many logging combinations.
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        (run):
+        (main):
+        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
+        (parse_args):
+        (passing_run):
+        (StreamTestingMixin.assertContains):
+        (MainTest.test_child_processes_2):
+        (MainTest.test_child_processes_min):
+        (MainTest.test_full_results_html):
+        (MainTest.test_no_tests_found):
+        (MainTest.test_no_tests_found_2):
+        (MainTest.test_repeat_each_iterations_num_tests):
+        (MainTest.test_additional_platform_directory):
+        (RebaselineTest.assertBaselines):
+        * Scripts/webkitpy/layout_tests/views/printing.py:
+        (print_options):
+        (Printer.__init__):
+        (Printer.enabled):
+        (Printer.print_unexpected_results):
+        * Scripts/webkitpy/layout_tests/views/printing_unittest.py:
+        (TestUtilityFunctions.test_print_options):
+        (Testprinter.get_result_summary):
+        (Testprinter.test_configure_and_cleanup):
+        (Testprinter.test_print_config):
+        (Testprinter.test_print_one_line_summary):
+        (Testprinter.test_print_unexpected_results):
+        (test_details):
+        (test_default):
+        (test_quiet):
+        (test_verbose):
+
 2012-08-06  Xianzhu Wang  <wangxianzhu@chromium.org>
 
         [Chromium-Android] Store test executable, data and fonts in /data/local/tmp
index fb578b0..109baf6 100755 (executable)
@@ -97,11 +97,6 @@ def run(port, options, args, regular_output=sys.stderr, buildbot_output=sys.stdo
         for warning in warnings:
             _log.warning(warning)
 
-        if options.help_printing:
-            printer.help_printing()
-            printer.cleanup()
-            return 0
-
         if options.lint_test_files:
             return lint(port, options)
 
@@ -485,7 +480,7 @@ def main(argv=None):
         traceback.print_exc(file=sys.stderr)
         raise
 
-    logging.getLogger().setLevel(logging.DEBUG if options.verbose else logging.INFO)
+    logging.getLogger().setLevel(logging.DEBUG if options.debug_rwt_logging else logging.INFO)
     return run(port, options, args)
 
 
index 02e75ba..fc699bc 100755 (executable)
@@ -60,10 +60,7 @@ from webkitpy.tool.mocktool import MockOptions
 
 def parse_args(extra_args=None, record_results=False, tests_included=False, new_results=False, print_nothing=True):
     extra_args = extra_args or []
-    if print_nothing:
-        args = ['--print', 'nothing']
-    else:
-        args = []
+    args = []
     if not '--platform' in extra_args:
         args.extend(['--platform', 'test'])
     if not record_results:
@@ -95,7 +92,7 @@ def passing_run(extra_args=None, port_obj=None, record_results=False, tests_incl
     buildbot_output = StringIO.StringIO()
     regular_output = StringIO.StringIO()
     res = run_webkit_tests.run(port_obj, options, parsed_args, buildbot_output=buildbot_output, regular_output=regular_output)
-    return res == 0 and not regular_output.getvalue() and not buildbot_output.getvalue()
+    return res == 0
 
 
 def logging_run(extra_args=None, port_obj=None, record_results=False, tests_included=False, host=None, new_results=False, shared_port=True):
@@ -186,9 +183,6 @@ class StreamTestingMixin(object):
     def assertContains(self, stream, string):
         self.assertTrue(string in stream.getvalue())
 
-    def assertContainsLine(self, stream, string):
-        self.assertTrue(string in stream.buflist)
-
     def assertEmpty(self, stream):
         self.assertFalse(stream.getvalue())
 
@@ -310,13 +304,13 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
     def test_child_processes_2(self):
         if self.should_test_processes:
             _, _, regular_output, _ = logging_run(
-                ['--print', 'config', '--child-processes', '2'], shared_port=False)
+                ['--debug-rwt-logging', '--child-processes', '2'], shared_port=False)
             self.assertTrue(any(['Running 2 ' in line for line in regular_output.buflist]))
 
     def test_child_processes_min(self):
         if self.should_test_processes:
             _, _, regular_output, _ = logging_run(
-                ['--print', 'config', '--child-processes', '2', 'passes'],
+                ['--debug-rwt-logging', '--child-processes', '2', 'passes'],
                 tests_included=True, shared_port=False)
             self.assertTrue(any(['Running 1 ' in line for line in regular_output.buflist]))
 
@@ -349,12 +343,6 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
         res, out, err, user = logging_run(['--full-results-html'])
         self.assertEqual(res, 0)
 
-    def test_help_printing(self):
-        res, out, err, user = logging_run(['--help-printing'])
-        self.assertEqual(res, 0)
-        self.assertEmpty(out)
-        self.assertNotEmpty(err)
-
     def test_hung_thread(self):
         res, out, err, user = logging_run(['--run-singly', '--time-out-ms=50',
                                           'failures/expected/hang.html'],
@@ -378,13 +366,13 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
         res, out, err, user = logging_run(['resources'], tests_included=True)
         self.assertEqual(res, -1)
         self.assertEmpty(out)
-        self.assertContainsLine(err, 'No tests to run.\n')
+        self.assertContains(err, 'No tests to run.\n')
 
     def test_no_tests_found_2(self):
         res, out, err, user = logging_run(['foo'], tests_included=True)
         self.assertEqual(res, -1)
         self.assertEmpty(out)
-        self.assertContainsLine(err, 'No tests to run.\n')
+        self.assertContains(err, 'No tests to run.\n')
 
     def test_randomize_order(self):
         # FIXME: verify order was shuffled
@@ -439,11 +427,11 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
         host = MockHost()
         res, out, err, _ = logging_run(['--iterations', '2',
                                         '--repeat-each', '4',
-                                        '--print', 'everything',
+                                        '--debug-rwt-logging',
                                         'passes/text.html', 'failures/expected/text.html'],
                                        tests_included=True, host=host, record_results=True)
-        self.assertContainsLine(out, "=> Results: 8/16 tests passed (50.0%)\n")
-        self.assertContainsLine(err, "All 16 tests ran as expected.\n")
+        self.assertContains(out, "=> Results: 8/16 tests passed (50.0%)\n")
+        self.assertContains(err, "All 16 tests ran as expected.\n")
 
     def test_run_chunk(self):
         # Test that we actually select the right chunk
@@ -863,7 +851,7 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
         self.assertTrue(passing_run(['--additional-platform-directory', '/tmp/foo', '--additional-platform-directory', '/tmp/bar']))
 
         res, buildbot_output, regular_output, user = logging_run(['--additional-platform-directory', 'foo'])
-        self.assertContainsLine(regular_output, '--additional-platform-directory=foo is ignored since it is not absolute\n')
+        self.assertContains(regular_output, '--additional-platform-directory=foo is ignored since it is not absolute\n')
 
     def test_additional_expectations(self):
         host = MockHost()
@@ -989,7 +977,7 @@ class RebaselineTest(unittest.TestCase, StreamTestingMixin):
             baseline = file + "-expected" + ext
             baseline_msg = 'Writing new expected result "%s"\n' % baseline
             self.assertTrue(any(f.find(baseline) != -1 for f in file_list))
-            self.assertContainsLine(err, baseline_msg)
+            self.assertContains(err, baseline_msg)
 
     # FIXME: Add tests to ensure that we're *not* writing baselines when we're not
     # supposed to be.
index 8bc89b2..b21812d 100644 (file)
@@ -40,113 +40,21 @@ from webkitpy.layout_tests.views.metered_stream import MeteredStream
 
 NUM_SLOW_TESTS_TO_LOG = 10
 
-PRINT_DEFAULT = "misc,one-line-progress,one-line-summary,unexpected,unexpected-results,updates"
+PRINT_QUIET = "one-line-progress,one-line-summary,unexpected,unexpected-results,updates"
+PRINT_DEFAULT = "config,misc,one-line-progress,one-line-summary,unexpected,unexpected-results,updates"
 PRINT_EVERYTHING = "actual,config,expected,misc,one-line-progress,one-line-summary,slowest,timing,unexpected,unexpected-results,updates"
 
-HELP_PRINTING = """
-Output for run-webkit-tests is controlled by a comma-separated list of
-values passed to --print.  Values either influence the overall output, or
-the output at the beginning of the run, during the run, or at the end:
-
-Overall options:
-    nothing             don't print anything. This overrides every other option
-    default             include the default options. This is useful for logging
-                        the default options plus additional settings.
-    everything          print (almost) everything (except the trace-* options,
-                        see below for the full list )
-    misc                print miscellaneous things like blank lines
-
-At the beginning of the run:
-    config              print the test run configuration
-    expected            print a summary of what is expected to happen
-                        (# passes, # failures, etc.)
-
-During the run:
-    one-line-progress   print a one-line progress message or bar
-    unexpected          print any unexpected results as they occur
-    updates             print updates on which stage is executing
-    trace-everything    print detailed info on every test's results
-                        (baselines, expectation, time it took to run). If
-                        this is specified it will override the '*-progress'
-                        options, the 'trace-unexpected' option, and the
-                        'unexpected' option.
-    trace-unexpected    like 'trace-everything', but only for tests with
-                        unexpected results. If this option is specified,
-                        it will override the 'unexpected' option.
-
-At the end of the run:
-    actual              print a summary of the actual results
-    slowest             print %(slowest)d slowest tests and the time they took
-    timing              print timing statistics
-    unexpected-results  print a list of the tests with unexpected results
-    one-line-summary    print a one-line summary of the run
-
-Notes:
-    - If 'nothing' is specified, it overrides all of the other options.
-    - Specifying --verbose is equivalent to --print everything plus it
-      changes the format of the log messages to add timestamps and other
-      information. If you specify --verbose and --print X, then X overrides
-      the --print everything implied by --verbose.
-
---print 'everything' is equivalent to --print '%(everything)s'.
-
-The default (--print default) is equivalent to --print '%(default)s'.
-""" % {'slowest': NUM_SLOW_TESTS_TO_LOG, 'everything': PRINT_EVERYTHING,
-       'default': PRINT_DEFAULT}
-
-
 def print_options():
     return [
-        # Note: We use print_options rather than just 'print' because print
-        # is a reserved word.
-        # Note: Also, we don't specify a default value so we can detect when
-        # no flag is specified on the command line and use different defaults
-        # based on whether or not --verbose is specified (since --print
-        # overrides --verbose).
-        optparse.make_option("--print", dest="print_options",
-            help=("controls print output of test run. "
-                  "Use --help-printing for more.")),
-        optparse.make_option("--help-printing", action="store_true",
-            help="show detailed help on controlling print output"),
-        optparse.make_option("-v", "--verbose", action="store_true",
-            default=False, help="include debug-level logging"),
-   ]
-
-
-def parse_print_options(print_options, verbose):
-    """Parse the options provided to --print and dedup and rank them.
-
-    Returns
-        a set() of switches that govern how logging is done
-
-    """
-    if print_options:
-        switches = set(print_options.split(','))
-    elif verbose:
-        switches = set(PRINT_EVERYTHING.split(','))
-    else:
-        switches = set(PRINT_DEFAULT.split(','))
-
-    if 'nothing' in switches:
-        return set()
-
-    if 'everything' in switches:
-        switches.discard('everything')
-        switches.update(set(PRINT_EVERYTHING.split(',')))
-
-    if 'default' in switches:
-        switches.discard('default')
-        switches.update(set(PRINT_DEFAULT.split(',')))
-
-    if 'trace-everything' in switches:
-        switches.discard('one-line-progress')
-        switches.discard('trace-unexpected')
-        switches.discard('unexpected')
-
-    if 'trace-unexpected' in switches:
-        switches.discard('unexpected')
-
-    return switches
+        optparse.make_option('-q', '--quiet', action='store_true', default=False,
+                             help='run quietly (errors, warnings, and progress only)'),
+        optparse.make_option('-v', '--verbose', action='store_true', default=False, dest='debug_rwt_logging',
+                             help='same as --debug-rwt-logging (for now)'),
+        optparse.make_option('--details', action='store_true', default=False,
+                             help='print detailed information about each test'),
+        optparse.make_option('--debug-rwt-logging', action='store_true', default=False,
+                             help='print timestamps and debug information for run-webkit-tests itself'),
+    ]
 
 
 class Printer(object):
@@ -175,8 +83,18 @@ class Printer(object):
         self._port = port
         self._options = options
         self._buildbot_stream = buildbot_output
-        self._meter = MeteredStream(regular_output, options.verbose, logger=logger)
-        self.switches = parse_print_options(options.print_options, options.verbose)
+
+        if options.debug_rwt_logging:
+            self.switches = PRINT_EVERYTHING.split(',')
+        elif options.quiet:
+            self.switches = PRINT_QUIET.split(',')
+        else:
+            self.switches = PRINT_DEFAULT.split(',')
+
+        if options.details:
+            self.switches.append('trace-everything')
+
+        self._meter = MeteredStream(regular_output, options.debug_rwt_logging, logger=logger)
 
     def cleanup(self):
         self._meter.cleanup()
@@ -191,9 +109,6 @@ class Printer(object):
     def enabled(self, option):
         return option in self.switches
 
-    def help_printing(self):
-        self._write(HELP_PRINTING)
-
     def print_config(self):
         """Prints the configuration for the test run."""
         self._print_config("Using port '%s'" % self._port.name())
@@ -696,7 +611,7 @@ class Printer(object):
                 self._buildbot_stream.write("\n")
             self._buildbot_stream.write("\n")
 
-        if len(unexpected_results['tests']) and self._options.verbose:
+        if len(unexpected_results['tests']) and self._options.debug_rwt_logging:
             self._buildbot_stream.write("%s\n" % ("-" * 78))
 
     def write_update(self, msg):
index 7505d5c..fa80aca 100644 (file)
@@ -57,36 +57,6 @@ class TestUtilityFunctions(unittest.TestCase):
         options, args = get_options([])
         self.assertTrue(options is not None)
 
-    def test_parse_print_options(self):
-        def test_switches(args, expected_switches_str, verbose=False):
-            options, args = get_options(args)
-            if expected_switches_str:
-                expected_switches = set(expected_switches_str.split(','))
-            else:
-                expected_switches = set()
-            switches = printing.parse_print_options(options.print_options,
-                                                    verbose)
-            self.assertEqual(expected_switches, switches)
-
-        # test that we default to the default set of switches
-        test_switches([], printing.PRINT_DEFAULT)
-
-        # test that verbose defaults to everything
-        test_switches([], printing.PRINT_EVERYTHING, verbose=True)
-
-        # test that --print default does what it's supposed to
-        test_switches(['--print', 'default'], printing.PRINT_DEFAULT)
-
-        # test that --print nothing does what it's supposed to
-        test_switches(['--print', 'nothing'], None)
-
-        # test that --print everything does what it's supposed to
-        test_switches(['--print', 'everything'], printing.PRINT_EVERYTHING)
-
-        # this tests that '--print X' overrides '--verbose'
-        test_switches(['--print', 'actual'], 'actual', verbose=True)
-
-
 
 class  Testprinter(unittest.TestCase):
     def assertEmpty(self, stream):
@@ -133,59 +103,16 @@ class  Testprinter(unittest.TestCase):
         rs = result_summary.ResultSummary(expectations, test_names, 1, set())
         return test_names, rs, expectations
 
-    def test_help_printer(self):
-        # Here and below we'll call the "regular" printer err and the
-        # buildbot printer out; this corresponds to how things run on the
-        # bots with stderr and stdout.
-        printer, err, out = self.get_printer()
-
-        # This routine should print something to stdout. testing what it is
-        # is kind of pointless.
-        printer.help_printing()
-        self.assertNotEmpty(err)
-        self.assertEmpty(out)
-
-    def do_switch_tests(self, method_name, switch, to_buildbot,
-                        message='hello', exp_err=None, exp_bot=None):
-        def do_helper(method_name, switch, message, exp_err, exp_bot):
-            printer, err, bot = self.get_printer(['--print', switch], tty=True)
-            getattr(printer, method_name)(message)
-            self.assertEqual(err.buflist, exp_err)
-            self.assertEqual(bot.buflist, exp_bot)
-
-        if to_buildbot:
-            if exp_err is None:
-                exp_err = []
-            if exp_bot is None:
-                exp_bot = [message + "\n"]
-        else:
-            if exp_err is None:
-                exp_err = [message + "\n"]
-            if exp_bot is None:
-                exp_bot = []
-        do_helper(method_name, 'nothing', 'hello', [], [])
-        do_helper(method_name, switch, 'hello', exp_err, exp_bot)
-        do_helper(method_name, 'everything', 'hello', exp_err, exp_bot)
-
     def test_configure_and_cleanup(self):
         # This test verifies that calling cleanup repeatedly and deleting
         # the object is safe.
-        printer, err, out = self.get_printer(['--print', 'everything'])
+        printer, err, out = self.get_printer()
         printer.cleanup()
         printer.cleanup()
         printer = None
 
-    def test_print_actual(self):
-        # Actual results need to be logged to the buildbot's stream.
-        self.do_switch_tests('print_actual', 'actual', to_buildbot=True)
-
-    def test_print_actual_buildbot(self):
-        # FIXME: Test that the format of the actual results matches what the
-        # buildbot is expecting.
-        pass
-
-    def test_fallback_path_in_config(self):
-        printer, err, out = self.get_printer(['--print', 'everything'])
+    def test_print_config(self):
+        printer, err, out = self.get_printer()
         # FIXME: it's lame that i have to set these options directly.
         printer._options.results_directory = '/tmp'
         printer._options.pixel_tests = True
@@ -195,201 +122,27 @@ class  Testprinter(unittest.TestCase):
         printer.print_config()
         self.assertTrue('Baseline search path: test-mac-leopard -> test-mac-snowleopard -> generic' in err.getvalue())
 
-    def test_print_config(self):
-        self.do_switch_tests('_print_config', 'config', to_buildbot=False)
-
-    def test_print_expected(self):
-        self.do_switch_tests('_print_expected', 'expected', to_buildbot=False)
-
-    def test_print_timing(self):
-        self.do_switch_tests('print_timing', 'timing', to_buildbot=False)
-
-    def test_write_update(self):
-        # Note that there shouldn't be a carriage return here; updates()
-        # are meant to be overwritten.
-        self.do_switch_tests('write_update', 'updates', to_buildbot=False,
-                             message='hello', exp_err=['hello'])
-
     def test_print_one_line_summary(self):
-        printer, err, out = self.get_printer(['--print', 'nothing'])
-        printer.print_one_line_summary(1, 1, 0)
-        self.assertEmpty(err)
-
-        printer, err, out = self.get_printer(['--print', 'one-line-summary'])
+        printer, err, out = self.get_printer()
         printer.print_one_line_summary(1, 1, 0)
         self.assertWritten(err, ["The test ran as expected.\n", "\n"])
 
-        printer, err, out = self.get_printer(['--print', 'everything'])
+        printer, err, out = self.get_printer()
         printer.print_one_line_summary(1, 1, 0)
         self.assertWritten(err, ["The test ran as expected.\n", "\n"])
 
-        printer, err, out = self.get_printer(['--print', 'everything'])
+        printer, err, out = self.get_printer()
         printer.print_one_line_summary(2, 1, 1)
         self.assertWritten(err, ["1 test ran as expected, 1 didn't:\n", "\n"])
 
-        printer, err, out = self.get_printer(['--print', 'everything'])
+        printer, err, out = self.get_printer()
         printer.print_one_line_summary(3, 2, 1)
         self.assertWritten(err, ["2 tests ran as expected, 1 didn't:\n", "\n"])
 
-        printer, err, out = self.get_printer(['--print', 'everything'])
+        printer, err, out = self.get_printer()
         printer.print_one_line_summary(3, 2, 0)
         self.assertWritten(err, ['\n', "2 tests ran as expected (1 didn't run).\n", '\n'])
 
-
-    def test_print_test_result(self):
-        # Note here that we don't use meaningful exp_str and got_str values;
-        # the actual contents of the string are treated opaquely by
-        # print_test_result() when tracing, and usually we don't want
-        # to test what exactly is printed, just that something
-        # was printed (or that nothing was printed).
-        #
-        # FIXME: this is actually some goofy layering; it would be nice
-        # we could refactor it so that the args weren't redundant. Maybe
-        # the TestResult should contain what was expected, and the
-        # strings could be derived from the TestResult?
-        printer, err, out = self.get_printer(['--print', 'nothing'])
-        result = self.get_result('passes/image.html')
-        printer.print_test_result(result, expected=False, exp_str='',
-                                  got_str='')
-        self.assertEmpty(err)
-
-        printer, err, out = self.get_printer(['--print', 'unexpected'])
-        printer.print_test_result(result, expected=True, exp_str='',
-                                  got_str='')
-        self.assertEmpty(err)
-        printer.print_test_result(result, expected=False, exp_str='',
-                                  got_str='')
-        self.assertWritten(err, ['  passes/image.html -> unexpected pass\n'])
-
-        printer, err, out = self.get_printer(['--print', 'everything'])
-        printer.print_test_result(result, expected=True, exp_str='',
-                                  got_str='')
-        self.assertEmpty(err)
-
-        printer.print_test_result(result, expected=False, exp_str='',
-                                  got_str='')
-        self.assertWritten(err, ['  passes/image.html -> unexpected pass\n'])
-
-        printer, err, out = self.get_printer(['--print', 'nothing'])
-        printer.print_test_result(result, expected=False, exp_str='',
-                                  got_str='')
-        self.assertEmpty(err)
-
-        printer, err, out = self.get_printer(['--print',
-                                              'trace-unexpected'])
-        printer.print_test_result(result, expected=True, exp_str='',
-                                  got_str='')
-        self.assertEmpty(err)
-
-        printer, err, out = self.get_printer(['--print',
-                                              'trace-unexpected'])
-        printer.print_test_result(result, expected=False, exp_str='',
-                                  got_str='')
-        self.assertNotEmpty(err)
-
-        printer, err, out = self.get_printer(['--print',
-                                              'trace-unexpected'])
-        result = self.get_result("passes/text.html")
-        printer.print_test_result(result, expected=False, exp_str='',
-                                  got_str='')
-        self.assertNotEmpty(err)
-
-        printer, err, out = self.get_printer(['--print',
-                                              'trace-unexpected'])
-        result = self.get_result("passes/text.html")
-        printer.print_test_result(result, expected=False, exp_str='',
-                                  got_str='')
-        self.assertNotEmpty(err)
-
-        printer, err, out = self.get_printer(['--print', 'trace-everything'])
-        result = self.get_result('passes/image.html')
-        printer.print_test_result(result, expected=True, exp_str='',
-                                  got_str='')
-        result = self.get_result('failures/expected/missing_text.html')
-        printer.print_test_result(result, expected=True, exp_str='',
-                                  got_str='')
-        result = self.get_result('failures/expected/missing_check.html')
-        printer.print_test_result(result, expected=True, exp_str='',
-                                  got_str='')
-        result = self.get_result('failures/expected/missing_image.html')
-        printer.print_test_result(result, expected=True, exp_str='',
-                                  got_str='')
-        self.assertNotEmpty(err)
-
-        printer, err, out = self.get_printer(['--print', 'trace-everything'])
-        result = self.get_result('passes/image.html')
-        printer.print_test_result(result, expected=False, exp_str='',
-                                  got_str='')
-
-    def test_print_progress(self):
-        expectations = ''
-
-        printer, err, out = self.get_printer(['--print', 'nothing'])
-        tests = ['passes/text.html', 'failures/expected/timeout.html',
-                 'failures/expected/crash.html']
-        paths, rs, exp = self.get_result_summary(tests, expectations)
-
-        # First, test that we print nothing when we shouldn't print anything.
-        printer.print_progress(rs, False, paths)
-        self.assertEmpty(out)
-        self.assertEmpty(err)
-
-        printer.print_progress(rs, True, paths)
-        self.assertEmpty(out)
-        self.assertEmpty(err)
-
-        # Now test that we do print things.
-        printer, err, out = self.get_printer(['--print', 'one-line-progress'])
-        printer.print_progress(rs, False, paths)
-        self.assertEmpty(out)
-        self.assertNotEmpty(err)
-
-        printer, err, out = self.get_printer(['--print', 'one-line-progress'])
-        printer.print_progress(rs, True, paths)
-        self.assertEmpty(out)
-        self.assertNotEmpty(err)
-
-        printer, err, out = self.get_printer(['--print', 'one-line-progress'])
-        rs.remaining = 0
-        printer.print_progress(rs, False, paths)
-        self.assertEmpty(out)
-        self.assertNotEmpty(err)
-
-        printer.print_progress(rs, True, paths)
-        self.assertEmpty(out)
-        self.assertNotEmpty(err)
-
-
-
-    def test_write_nothing(self):
-        printer, err, out = self.get_printer(['--print', 'nothing'])
-        printer.write("foo")
-        self.assertEmpty(err)
-
-    def test_write_misc(self):
-        printer, err, out = self.get_printer(['--print', 'misc'])
-        printer.write("foo")
-        self.assertNotEmpty(err)
-
-        printer, err, out = self.get_printer(['--print', 'misc'])
-        printer.write("foo", "config")
-        self.assertEmpty(err)
-
-    def test_write_everything(self):
-        printer, err, out = self.get_printer(['--print', 'everything'])
-        printer.write("foo")
-        self.assertNotEmpty(err)
-
-        printer, err, out = self.get_printer(['--print', 'everything'])
-        printer.write("foo", "config")
-        self.assertNotEmpty(err)
-
-    def test_write_verbose(self):
-        printer, err, out = self.get_printer(['--verbose'])
-        printer.write("foo")
-        self.assertTrue("foo" in err.buflist[0])
-        self.assertEmpty(out)
-
     def test_print_unexpected_results(self):
         # This routine is the only one that prints stuff that the bots
         # care about.
@@ -442,13 +195,7 @@ class  Testprinter(unittest.TestCase):
         tests = ['passes/text.html', 'failures/expected/timeout.html', 'failures/expected/crash.html']
         expectations = ''
 
-        printer, err, out = self.get_printer(['--print', 'nothing'])
-        ur = get_unexpected_results(expected=False, passing=False, flaky=False)
-        printer.print_unexpected_results(ur)
-        self.assertEmpty(err)
-        self.assertEmpty(out)
-
-        printer, err, out = self.get_printer(['--print', 'unexpected-results'])
+        printer, err, out = self.get_printer()
 
         # test everything running as expected
         ur = get_unexpected_results(expected=True, passing=False, flaky=False)
@@ -457,20 +204,20 @@ class  Testprinter(unittest.TestCase):
         self.assertEmpty(out)
 
         # test failures
-        printer, err, out = self.get_printer(['--print', 'unexpected-results'])
+        printer, err, out = self.get_printer()
         ur = get_unexpected_results(expected=False, passing=False, flaky=False)
         printer.print_unexpected_results(ur)
         self.assertEmpty(err)
         self.assertNotEmpty(out)
 
         # test unexpected flaky
-        printer, err, out = self.get_printer(['--print', 'unexpected-results'])
+        printer, err, out = self.get_printer()
         ur = get_unexpected_results(expected=False, passing=False, flaky=True)
         printer.print_unexpected_results(ur)
         self.assertEmpty(err)
         self.assertNotEmpty(out)
 
-        printer, err, out = self.get_printer(['--print', 'everything'])
+        printer, err, out = self.get_printer()
         ur = get_unexpected_results(expected=False, passing=False, flaky=False)
         printer.print_unexpected_results(ur)
         self.assertEmpty(err)
@@ -480,30 +227,51 @@ class  Testprinter(unittest.TestCase):
 BUGX : failures/expected/crash.html = CRASH
 BUGX : failures/expected/timeout.html = TIMEOUT
 """
-        printer, err, out = self.get_printer(['--print', 'unexpected-results'])
+        printer, err, out = self.get_printer()
         ur = get_unexpected_results(expected=False, passing=False, flaky=False)
         printer.print_unexpected_results(ur)
         self.assertEmpty(err)
         self.assertNotEmpty(out)
 
-        printer, err, out = self.get_printer(['--print', 'unexpected-results'])
+        printer, err, out = self.get_printer()
         ur = get_unexpected_results(expected=False, passing=True, flaky=False)
         printer.print_unexpected_results(ur)
         self.assertEmpty(err)
         self.assertNotEmpty(out)
 
-        # Test handling of --verbose as well.
-        printer, err, out = self.get_printer(['--verbose'])
-        ur = get_unexpected_results(expected=False, passing=False, flaky=False)
-        printer.print_unexpected_results(ur)
-        # FIXME: debug output from the port and scm objects may or may not go
-        # to stderr, so there's no point in testing its contents here.
-        self.assertNotEmpty(out)
-
     def test_print_unexpected_results_buildbot(self):
         # FIXME: Test that print_unexpected_results() produces the printer the
         # buildbot is expecting.
         pass
 
+    def test_details(self):
+        printer, err, _ = self.get_printer(['--details'])
+        result = self.get_result('passes/image.html')
+        printer.print_test_result(result, expected=False, exp_str='', got_str='')
+        self.assertNotEmpty(err)
+
+    def test_default(self):
+        printer, err, _ = self.get_printer()
+        printer.print_timing("foo")
+        self.assertEmpty(err)
+        printer._print_config("foo")
+        self.assertNotEmpty(err)
+
+    def test_quiet(self):
+        printer, err, _ = self.get_printer(['--quiet'])
+        printer._print_config("foo")
+        printer.print_timing("foo")
+        self.assertEmpty(err)
+
+    def test_verbose(self):
+        printer, err, _ = self.get_printer(['--verbose'])
+        printer.print_timing("foo")
+        self.assertNotEmpty(err)
+
+        printer, err, _ = self.get_printer(['--verbose'])
+        printer._print_config("foo")
+        self.assertNotEmpty(err)
+
+
 if __name__ == '__main__':
     unittest.main()