()
| 284 | |
| 285 | |
| 286 | def main(): |
| 287 | # Look for directories like `iOSTestbed` as an indicator of the platforms |
| 288 | # that the testbed folder supports. The original source testbed can support |
| 289 | # many platforms, but when cloned, only one platform is preserved. |
| 290 | available_platforms = [ |
| 291 | platform |
| 292 | for platform in ["iOS"] |
| 293 | if (Path(__file__).parent / f"{platform}Testbed").is_dir() |
| 294 | ] |
| 295 | |
| 296 | parser = argparse.ArgumentParser( |
| 297 | description=( |
| 298 | "Manages the process of testing an Apple Python project " |
| 299 | "through Xcode." |
| 300 | ), |
| 301 | ) |
| 302 | |
| 303 | subcommands = parser.add_subparsers(dest="subcommand") |
| 304 | clone = subcommands.add_parser( |
| 305 | "clone", |
| 306 | description=( |
| 307 | "Clone the testbed project, copying in a Python framework and" |
| 308 | "any specified application code." |
| 309 | ), |
| 310 | help="Clone a testbed project to a new location.", |
| 311 | ) |
| 312 | clone.add_argument( |
| 313 | "--framework", |
| 314 | help=( |
| 315 | "The location of the XCFramework (or simulator-only slice of an " |
| 316 | "XCFramework) to use when running the testbed" |
| 317 | ), |
| 318 | ) |
| 319 | clone.add_argument( |
| 320 | "--platform", |
| 321 | dest="platform", |
| 322 | choices=available_platforms, |
| 323 | default=available_platforms[0], |
| 324 | help=f"The platform to target (default: {available_platforms[0]})", |
| 325 | ) |
| 326 | clone.add_argument( |
| 327 | "--app", |
| 328 | dest="apps", |
| 329 | action="append", |
| 330 | default=[], |
| 331 | help="The location of any code to include in the testbed project", |
| 332 | ) |
| 333 | clone.add_argument( |
| 334 | "location", |
| 335 | help="The path where the testbed will be cloned.", |
| 336 | ) |
| 337 | |
| 338 | run = subcommands.add_parser( |
| 339 | "run", |
| 340 | usage=( |
| 341 | "%(prog)s [-h] [--simulator SIMULATOR] -- " |
| 342 | "<test arg> [<test arg> ...]" |
| 343 | ), |
no test coverage detected
searching dependent graphs…