Main entry point
()
| 391 | |
| 392 | |
| 393 | def main(): |
| 394 | """Main entry point""" |
| 395 | parser = argparse.ArgumentParser( |
| 396 | description='Streamlined test runner for XTOP', |
| 397 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 398 | epilog=""" |
| 399 | Examples: |
| 400 | python3 test_runner.py # Run all tests |
| 401 | python3 test_runner.py basic # Run basic tests only |
| 402 | python3 test_runner.py -v # Verbose output |
| 403 | python3 test_runner.py --save # Save results to JSON |
| 404 | """ |
| 405 | ) |
| 406 | |
| 407 | parser.add_argument( |
| 408 | 'suite', |
| 409 | nargs='?', |
| 410 | choices=['all', 'basic', 'latency', 'stack', 'advanced', 'format', 'schema', 'ui'], |
| 411 | default='all', |
| 412 | help='Test suite to run (default: all)' |
| 413 | ) |
| 414 | |
| 415 | parser.add_argument( |
| 416 | '-v', '--verbose', |
| 417 | action='store_true', |
| 418 | help='Show detailed output' |
| 419 | ) |
| 420 | |
| 421 | parser.add_argument( |
| 422 | '--save', |
| 423 | action='store_true', |
| 424 | help='Save results to JSON file' |
| 425 | ) |
| 426 | |
| 427 | args = parser.parse_args() |
| 428 | |
| 429 | # Create runner |
| 430 | runner = XtopTestRunner(verbose=args.verbose) |
| 431 | |
| 432 | # Run tests |
| 433 | if args.suite == 'all': |
| 434 | success = runner.run_all() |
| 435 | else: |
| 436 | success = runner.run_suite(args.suite) |
| 437 | |
| 438 | # Save results if requested |
| 439 | if args.save and runner.suites: |
| 440 | runner.save_results() |
| 441 | |
| 442 | # Exit with appropriate code |
| 443 | sys.exit(0 if success else 1) |
| 444 | |
| 445 | |
| 446 | if __name__ == '__main__': |
no test coverage detected