| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """List all the test cases for a google test. | |
| 7 | |
| 8 See more info at http://code.google.com/p/googletest/. | |
| 9 """ | |
| 10 | |
| 11 import os | |
| 12 import sys | |
| 13 | |
| 14 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| 15 if not ROOT_DIR in sys.path: | |
| 16 sys.path.insert(0, ROOT_DIR) | |
| 17 | |
| 18 import run_test_cases | |
| 19 from utils import tools | |
| 20 | |
| 21 | |
| 22 def main(): | |
| 23 """CLI frontend to validate arguments.""" | |
| 24 tools.disable_buffering() | |
| 25 parser = run_test_cases.OptionParserWithTestShardingAndFiltering( | |
| 26 usage='%prog <options> [gtest]') | |
| 27 | |
| 28 # Override default seed value to default to 0. | |
| 29 parser.set_defaults(seed=0) | |
| 30 | |
| 31 options, args = parser.parse_args() | |
| 32 if not args: | |
| 33 parser.error('Please provide the executable to run') | |
| 34 | |
| 35 cmd = tools.fix_python_path(args) | |
| 36 try: | |
| 37 tests = run_test_cases.chromium_list_test_cases( | |
| 38 cmd, | |
| 39 os.getcwd(), | |
| 40 index=options.index, | |
| 41 shards=options.shards, | |
| 42 seed=options.seed, | |
| 43 disabled=options.disabled, | |
| 44 fails=options.fails, | |
| 45 flaky=options.flaky, | |
| 46 pre=False, | |
| 47 manual=options.manual) | |
| 48 for test in tests: | |
| 49 print test | |
| 50 except run_test_cases.Failure, e: | |
| 51 print e.args[0] | |
| 52 return e.args[1] | |
| 53 return 0 | |
| 54 | |
| 55 | |
| 56 if __name__ == '__main__': | |
| 57 sys.exit(main()) | |
| OLD | NEW |