Parse command line arguments and return typed Args dataclass
()
| 226 | |
| 227 | |
| 228 | def parse_args() -> Args: |
| 229 | """Parse command line arguments and return typed Args dataclass""" |
| 230 | parser = argparse.ArgumentParser(description="Run FastLED unit tests") |
| 231 | parser.add_argument("--test", help="Run specific test (without test_ prefix)") |
| 232 | parser.add_argument( |
| 233 | "--verbose", "-v", action="store_true", help="Show all test output" |
| 234 | ) |
| 235 | parser.add_argument("--jobs", "-j", type=int, help="Number of parallel jobs") |
| 236 | parser.add_argument( |
| 237 | "--stack-trace", |
| 238 | action="store_true", |
| 239 | help="Enable GDB stack trace dumps on test crashes/timeouts", |
| 240 | ) |
| 241 | |
| 242 | parsed_args = parser.parse_args() |
| 243 | |
| 244 | return Args( |
| 245 | test=parsed_args.test, |
| 246 | verbose=parsed_args.verbose, |
| 247 | jobs=parsed_args.jobs, |
| 248 | enable_stack_trace=parsed_args.stack_trace, |
| 249 | ) |
| 250 | |
| 251 | |
| 252 | def run_test( |
no test coverage detected