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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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', | 96 '-d', |
97 '--dummyproj', | 97 '--dummyproj', |
98 help='Dummy test project path.', | 98 help='Dummy test project path.', |
99 metavar='.xcodeproj', | 99 metavar='.xcodeproj', |
100 type=str, | 100 type=str, |
101 ) | 101 ) |
smut
2016/08/09 23:54:54
Unused? Remove if unused.
huangml1
2016/08/09 23:58:23
Done.
| |
102 parser.add_argument( | 102 parser.add_argument( |
103 '-e', | 103 '-e', |
104 '--env-var', | 104 '--env-var', |
105 action='append', | 105 action='append', |
106 help='Environment variable to pass to the test itself.', | 106 help='Environment variable to pass to the test itself.', |
107 metavar='ENV=val', | 107 metavar='ENV=val', |
108 type=str, | 108 type=str, |
109 ) | 109 ) |
110 parser.add_argument( | 110 parser.add_argument( |
111 '-i', | 111 '-i', |
(...skipping 11 matching lines...) Expand all Loading... | |
123 ) | 123 ) |
124 parser.add_argument( | 124 parser.add_argument( |
125 '-p', | 125 '-p', |
126 '--platform', | 126 '--platform', |
127 help='Platform to simulate.', | 127 help='Platform to simulate.', |
128 metavar='sim', | 128 metavar='sim', |
129 required=True, | 129 required=True, |
130 type=str, | 130 type=str, |
131 ) | 131 ) |
132 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( | |
140 '-v', | 133 '-v', |
141 '--version', | 134 '--version', |
142 help='Version of iOS the simulator should run.', | 135 help='Version of iOS the simulator should run.', |
143 metavar='ver', | 136 metavar='ver', |
144 required=True, | 137 required=True, |
145 type=str, | 138 type=str, |
146 ) | 139 ) |
147 parser.add_argument( | 140 parser.add_argument( |
141 '--xcodeproj', | |
142 help='Xcode project to run tests on.', | |
143 metavar='proj', | |
144 type=str, | |
145 ) | |
smut
2016/08/09 23:54:54
Where is this used?
huangml1
2016/08/09 23:58:23
This is used for the DeviceXCTestRunner. The devi
smut
2016/08/10 00:03:55
The run.py called downstream is not the same as th
| |
146 parser.add_argument( | |
148 '-x', | 147 '-x', |
149 '--xcode-version', | 148 '--xcode-version', |
150 help='Version of Xcode to use.', | 149 help='Version of Xcode to use.', |
151 metavar='ver', | 150 metavar='ver', |
152 type=str, | 151 type=str, |
153 ) | 152 ) |
153 parser.add_argument( | |
154 '--xctest', | |
155 help='Compiled xctest to run.', | |
156 metavar='xctest', | |
157 type=str, | |
158 ) | |
159 | |
154 sys.exit(main(*parser.parse_known_args())) | 160 sys.exit(main(*parser.parse_known_args())) |
OLD | NEW |