()
| 480 | |
| 481 | |
| 482 | def main() -> int: |
| 483 | parser = argparse.ArgumentParser( |
| 484 | description="Driver sweep test — tests multiple LED strip sizes and lane configurations for any driver" |
| 485 | ) |
| 486 | parser.add_argument( |
| 487 | "--driver", |
| 488 | type=str, |
| 489 | required=True, |
| 490 | help="Driver to test (e.g., PARLIO, RMT, SPI, I2S, UART, LCD_RGB)", |
| 491 | ) |
| 492 | parser.add_argument( |
| 493 | "--port", |
| 494 | type=str, |
| 495 | help="Serial port (auto-detected if not specified)", |
| 496 | ) |
| 497 | parser.add_argument( |
| 498 | "--verbose", |
| 499 | "-v", |
| 500 | action="store_true", |
| 501 | help="Enable verbose RPC output", |
| 502 | ) |
| 503 | parser.add_argument( |
| 504 | "--timeout", |
| 505 | type=float, |
| 506 | default=120.0, |
| 507 | help="Per-test timeout in seconds (default: 120)", |
| 508 | ) |
| 509 | parser.add_argument( |
| 510 | "--skip-flash", |
| 511 | action="store_true", |
| 512 | help="Skip compile/upload (assume device already flashed)", |
| 513 | ) |
| 514 | args = parser.parse_args() |
| 515 | |
| 516 | driver = args.driver.upper() |
| 517 | |
| 518 | # Detect port |
| 519 | port: str = args.port or "" |
| 520 | if not port: |
| 521 | print("Auto-detecting serial port...") |
| 522 | result = auto_detect_upload_port("esp32c6") |
| 523 | if not result.ok: |
| 524 | print("ERROR: No USB serial port found. Plug in the device or use --port.") |
| 525 | return 1 |
| 526 | port = str(result.selected_port) |
| 527 | print(f"Found: {port}") |
| 528 | |
| 529 | # Optionally compile and upload |
| 530 | if not args.skip_flash: |
| 531 | print(f"\nCompiling and uploading AutoResearch sketch...") |
| 532 | print("(Use --skip-flash to skip this step if already flashed)\n") |
| 533 | compile_cmd = [ |
| 534 | "bash", |
| 535 | "compile", |
| 536 | "esp32c6", |
| 537 | "--examples", |
| 538 | "AutoResearch", |
| 539 | ] |
no test coverage detected