| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Run an iOS GTest app. | 6 """Run an iOS GTest app. |
| 7 | 7 |
| 8 Sample usage: | 8 Sample usage: |
| 9 ./run.py \ | 9 ./run.py \ |
| 10 -a src/xcodebuild/Release-iphoneos/base_unittests.app \ | 10 -a src/xcodebuild/Release-iphoneos/base_unittests.app \ |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 # pylint: disable=relative-import | 25 # pylint: disable=relative-import |
| 26 from test_runner import SimulatorTestRunner, SimulatorXCTestRunner, \ | 26 from test_runner import SimulatorTestRunner, SimulatorXCTestRunner, \ |
| 27 TestRunnerError | 27 TestRunnerError |
| 28 | 28 |
| 29 | 29 |
| 30 def main(args, test_args): | 30 def main(args, test_args): |
| 31 summary = {} | 31 summary = {} |
| 32 test_runner = None | 32 test_runner = None |
| 33 | 33 |
| 34 try: | 34 try: |
| 35 if args.xctest: | 35 if args.test_host: |
| 36 test_runner = SimulatorXCTestRunner( | 36 test_runner = SimulatorXCTestRunner( |
| 37 args.app, | 37 args.app, |
| 38 args.xctest, | 38 args.test_host, |
| 39 args.iossim, | 39 args.dummyproj, |
| 40 args.platform, | 40 args.platform, |
| 41 args.version, | 41 args.version, |
| 42 env_vars=args.env_var, | 42 env_vars=args.env_var, |
| 43 gs_bucket=args.bucket, | 43 gs_bucket=args.bucket, |
| 44 test_args=test_args, | 44 test_args=test_args, |
| 45 xcode_version=args.xcode_version, | 45 xcode_version=args.xcode_version, |
| 46 ) | 46 ) |
| 47 else: | 47 else: |
| 48 test_runner = SimulatorTestRunner( | 48 test_runner = SimulatorTestRunner( |
| 49 args.app, | 49 args.app, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 type=str, | 86 type=str, |
| 87 ) | 87 ) |
| 88 parser.add_argument( | 88 parser.add_argument( |
| 89 '-b', | 89 '-b', |
| 90 '--bucket', | 90 '--bucket', |
| 91 help='Google Storage bucket to upload test data to.', | 91 help='Google Storage bucket to upload test data to.', |
| 92 metavar='path', | 92 metavar='path', |
| 93 type=str, | 93 type=str, |
| 94 ) | 94 ) |
| 95 parser.add_argument( | 95 parser.add_argument( |
| 96 '-d', |
| 97 '--dummyproj', |
| 98 help='Dummy test project path.', |
| 99 metavar='.xcodeproj', |
| 100 type=str, |
| 101 ) |
| 102 parser.add_argument( |
| 96 '-e', | 103 '-e', |
| 97 '--env-var', | 104 '--env-var', |
| 98 action='append', | 105 action='append', |
| 99 help='Environment variable to pass to the test itself.', | 106 help='Environment variable to pass to the test itself.', |
| 100 metavar='ENV=val', | 107 metavar='ENV=val', |
| 101 type=str, | 108 type=str, |
| 102 ) | 109 ) |
| 103 parser.add_argument( | 110 parser.add_argument( |
| 104 '-i', | 111 '-i', |
| 105 '--iossim', | 112 '--iossim', |
| (...skipping 10 matching lines...) Expand all Loading... |
| 116 ) | 123 ) |
| 117 parser.add_argument( | 124 parser.add_argument( |
| 118 '-p', | 125 '-p', |
| 119 '--platform', | 126 '--platform', |
| 120 help='Platform to simulate.', | 127 help='Platform to simulate.', |
| 121 metavar='sim', | 128 metavar='sim', |
| 122 required=True, | 129 required=True, |
| 123 type=str, | 130 type=str, |
| 124 ) | 131 ) |
| 125 parser.add_argument( | 132 parser.add_argument( |
| 133 '-t', |
| 134 '--test-host', |
| 135 help='Compiled test host to run tests.', |
| 136 metavar='host', |
| 137 type=str, |
| 138 ) |
| 139 parser.add_argument( |
| 126 '-v', | 140 '-v', |
| 127 '--version', | 141 '--version', |
| 128 help='Version of iOS the simulator should run.', | 142 help='Version of iOS the simulator should run.', |
| 129 metavar='ver', | 143 metavar='ver', |
| 130 required=True, | 144 required=True, |
| 131 type=str, | 145 type=str, |
| 132 ) | 146 ) |
| 133 parser.add_argument( | 147 parser.add_argument( |
| 134 '-x', | 148 '-x', |
| 135 '--xcode-version', | 149 '--xcode-version', |
| 136 help='Version of Xcode to use.', | 150 help='Version of Xcode to use.', |
| 137 metavar='ver', | 151 metavar='ver', |
| 138 type=str, | 152 type=str, |
| 139 ) | 153 ) |
| 140 parser.add_argument( | |
| 141 '--xctest', | |
| 142 help='Compiled xctest to run.', | |
| 143 metavar='xctest', | |
| 144 type=str, | |
| 145 ) | |
| 146 | |
| 147 sys.exit(main(*parser.parse_known_args())) | 154 sys.exit(main(*parser.parse_known_args())) |
| OLD | NEW |