Main test entry point
()
| 345 | |
| 346 | |
| 347 | def main(): |
| 348 | """Main test entry point""" |
| 349 | import argparse |
| 350 | |
| 351 | parser = argparse.ArgumentParser(description='Test OpenOCR functionality') |
| 352 | parser.add_argument( |
| 353 | '--test-type', |
| 354 | type=str, |
| 355 | default='all', |
| 356 | choices=['all', 'python', 'cli'], |
| 357 | help='Type of tests to run: all (default), python (API only), cli (command-line only)' |
| 358 | ) |
| 359 | |
| 360 | args = parser.parse_args() |
| 361 | |
| 362 | try: |
| 363 | tester = OpenOCRTester() |
| 364 | |
| 365 | if args.test_type == 'all': |
| 366 | tester.run_all_tests() |
| 367 | elif args.test_type == 'python': |
| 368 | tester.test_python_api() |
| 369 | elif args.test_type == 'cli': |
| 370 | tester.test_command_line() |
| 371 | |
| 372 | except Exception as e: |
| 373 | logger.error(f'Test suite failed: {e}') |
| 374 | import traceback |
| 375 | traceback.print_exc() |
| 376 | sys.exit(1) |
| 377 | |
| 378 | |
| 379 | if __name__ == '__main__': |
no test coverage detected