| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 # Copyright (c) 2012 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 import run_test_cases | |
| 15 | |
| 16 | |
| 17 def main(): | |
| 18 """CLI frontend to validate arguments.""" | |
| 19 run_test_cases.run_isolated.disable_buffering() | |
| 20 parser = run_test_cases.OptionParserWithTestShardingAndFiltering( | |
| 21 usage='%prog <options> [gtest]') | |
| 22 options, args = parser.parse_args() | |
| 23 if not args: | |
| 24 parser.error('Please provide the executable to run') | |
| 25 | |
| 26 cmd = run_test_cases.fix_python_path(args) | |
| 27 try: | |
| 28 tests = run_test_cases.list_test_cases( | |
| 29 cmd, | |
| 30 os.getcwd(), | |
| 31 index=options.index, | |
| 32 shards=options.shards, | |
| 33 disabled=options.disabled, | |
| 34 fails=options.fails, | |
| 35 flaky=options.flaky, | |
| 36 pre=False, | |
| 37 manual=options.manual, | |
| 38 seed=0) | |
| 39 for test in tests: | |
| 40 print test | |
| 41 except run_test_cases.Failure, e: | |
| 42 print e.args[0] | |
| 43 return e.args[1] | |
| 44 return 0 | |
| 45 | |
| 46 | |
| 47 if __name__ == '__main__': | |
| 48 sys.exit(main()) | |
| OLD | NEW |