|
39 | 39 | VideoTestStatus, |
40 | 40 | load_samples_from_json, |
41 | 41 | download_sample_assets, |
| 42 | + load_and_download_samples, |
42 | 43 | load_skip_list, |
43 | 44 | is_test_skipped, |
44 | 45 | SkipFilter, |
|
49 | 50 | ) |
50 | 51 |
|
51 | 52 | from tests.libs.video_test_utils import safe_main_wrapper, DEFAULT_TEST_TIMEOUT |
52 | | -from tests.video_test_framework_encode import VulkanVideoEncodeTestFramework |
53 | | -from tests.video_test_framework_decode import VulkanVideoDecodeTestFramework |
| 53 | +from tests.video_test_framework_encode import ( |
| 54 | + VulkanVideoEncodeTestFramework, |
| 55 | + EncodeTestSample, |
| 56 | +) |
| 57 | +from tests.video_test_framework_decode import ( |
| 58 | + VulkanVideoDecodeTestFramework, |
| 59 | + DecodeTestSample, |
| 60 | +) |
54 | 61 |
|
55 | 62 |
|
56 | 63 | @dataclass |
@@ -598,6 +605,10 @@ def create_argument_parser() -> argparse.ArgumentParser: |
598 | 605 | parser.add_argument( |
599 | 606 | "--no-auto-download", action="store_true", |
600 | 607 | help="Skip automatic download of missing/corrupt sample files") |
| 608 | + parser.add_argument( |
| 609 | + "--download-only", action="store_true", |
| 610 | + help="Download all test resources (encode and decode) and exit " |
| 611 | + "without running tests") |
601 | 612 | parser.add_argument( |
602 | 613 | "--deviceID", |
603 | 614 | help="Vulkan device ID to use for testing " |
@@ -655,6 +666,29 @@ def find_executables(args: argparse.Namespace) -> Tuple[str, str]: |
655 | 666 | return encoder_path, decoder_path |
656 | 667 |
|
657 | 668 |
|
| 669 | +def download_all_resources(args: argparse.Namespace) -> bool: |
| 670 | + """Download all test resources (encode and decode) without running tests""" |
| 671 | + print("=== Downloading All Test Resources ===\n") |
| 672 | + |
| 673 | + decode_json = args.decode_test_suite or "decode_samples.json" |
| 674 | + encode_json = args.encode_test_suite or "encode_samples.json" |
| 675 | + |
| 676 | + decode_ok = load_and_download_samples( |
| 677 | + DecodeTestSample, decode_json, "decode" |
| 678 | + ) |
| 679 | + encode_ok = load_and_download_samples( |
| 680 | + EncodeTestSample, encode_json, "encode" |
| 681 | + ) |
| 682 | + |
| 683 | + success = decode_ok and encode_ok |
| 684 | + if success: |
| 685 | + print("\n✓ All resources downloaded successfully") |
| 686 | + else: |
| 687 | + print("\n✗ Some resources failed to download") |
| 688 | + |
| 689 | + return success |
| 690 | + |
| 691 | + |
658 | 692 | def run_framework_tests(args: argparse.Namespace, encoder_path: str, |
659 | 693 | decoder_path: str) -> bool: |
660 | 694 | """Run the actual test framework""" |
@@ -725,6 +759,11 @@ def main() -> int: |
725 | 759 | list_all_samples(skip_list_path) |
726 | 760 | return 0 |
727 | 761 |
|
| 762 | + # Handle --download-only option |
| 763 | + if args.download_only: |
| 764 | + success = download_all_resources(args) |
| 765 | + return 0 if success else 1 |
| 766 | + |
728 | 767 | # Find executable paths |
729 | 768 | encoder_path, decoder_path = find_executables(args) |
730 | 769 |
|
|
0 commit comments