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.test_host: | 35 if args.xctest: |
36 test_runner = SimulatorXCTestRunner( | 36 test_runner = SimulatorXCTestRunner( |
37 args.app, | 37 args.app, |
38 args.test_host, | 38 args.xctest, |
39 args.dummyproj, | 39 args.iossim, |
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( | |
103 '-e', | 96 '-e', |
104 '--env-var', | 97 '--env-var', |
105 action='append', | 98 action='append', |
106 help='Environment variable to pass to the test itself.', | 99 help='Environment variable to pass to the test itself.', |
107 metavar='ENV=val', | 100 metavar='ENV=val', |
108 type=str, | 101 type=str, |
109 ) | 102 ) |
110 parser.add_argument( | 103 parser.add_argument( |
111 '-i', | 104 '-i', |
112 '--iossim', | 105 '--iossim', |
(...skipping 10 matching lines...) Expand all Loading... |
123 ) | 116 ) |
124 parser.add_argument( | 117 parser.add_argument( |
125 '-p', | 118 '-p', |
126 '--platform', | 119 '--platform', |
127 help='Platform to simulate.', | 120 help='Platform to simulate.', |
128 metavar='sim', | 121 metavar='sim', |
129 required=True, | 122 required=True, |
130 type=str, | 123 type=str, |
131 ) | 124 ) |
132 parser.add_argument( | 125 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( | |
140 '-v', | 126 '-v', |
141 '--version', | 127 '--version', |
142 help='Version of iOS the simulator should run.', | 128 help='Version of iOS the simulator should run.', |
143 metavar='ver', | 129 metavar='ver', |
144 required=True, | 130 required=True, |
145 type=str, | 131 type=str, |
146 ) | 132 ) |
147 parser.add_argument( | 133 parser.add_argument( |
148 '-x', | 134 '-x', |
149 '--xcode-version', | 135 '--xcode-version', |
150 help='Version of Xcode to use.', | 136 help='Version of Xcode to use.', |
151 metavar='ver', | 137 metavar='ver', |
152 type=str, | 138 type=str, |
153 ) | 139 ) |
| 140 parser.add_argument( |
| 141 '--xctest', |
| 142 help='Compiled xctest to run.', |
| 143 metavar='xctest', |
| 144 type=str, |
| 145 ) |
| 146 |
154 sys.exit(main(*parser.parse_known_args())) | 147 sys.exit(main(*parser.parse_known_args())) |
OLD | NEW |