OLD | NEW |
(Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 from .type_definitions import Handler |
| 6 |
| 7 |
| 8 class ListHandler(Handler): |
| 9 """List all of the tests instead of running them.""" |
| 10 SKIP_RUNLOOP = True |
| 11 |
| 12 # Used to collect all bare test names for command line test name completion. |
| 13 COMPLETION_LIST = None |
| 14 |
| 15 class ResultStageHandler(Handler.ResultStageHandler): |
| 16 @staticmethod |
| 17 def handle_Test(test): |
| 18 if ListHandler.COMPLETION_LIST is not None: |
| 19 ListHandler.COMPLETION_LIST.append(test.name) |
| 20 else: |
| 21 print test.name |
| 22 |
| 23 @staticmethod |
| 24 def handle_MultiTest(multi_test): |
| 25 print 'MultiTest(%r, atomic=%r)' % (multi_test.name, multi_test.atomic) |
| 26 for test in multi_test.tests: |
| 27 if ListHandler.COMPLETION_LIST is not None: |
| 28 ListHandler.COMPLETION_LIST.append(test.name) |
| 29 else: |
| 30 print '|', test.name |
| 31 |
| 32 # TODO(iannucci): group tests by dir? |
| 33 # TODO(iannucci): print more data about the test in verbose mode? |
OLD | NEW |