Categorize a test by directory and type. Categories: - fl_tests: Tests from fl/ directory (stdlib-like utilities) - fx_tests: Tests from fx/ directory or containing "fx" (effects framework) - noise_tests: Tests from noise/ directory - platform_tests: Tests from platforms/ d
(test_name: str, test_file_path: str)
| 40 | |
| 41 | |
| 42 | def categorize_test(test_name: str, test_file_path: str) -> str: |
| 43 | """ |
| 44 | Categorize a test by directory and type. |
| 45 | |
| 46 | Categories: |
| 47 | - fl_tests: Tests from fl/ directory (stdlib-like utilities) |
| 48 | - fx_tests: Tests from fx/ directory or containing "fx" (effects framework) |
| 49 | - noise_tests: Tests from noise/ directory |
| 50 | - platform_tests: Tests from platforms/ directory |
| 51 | - core_tests: All other tests |
| 52 | |
| 53 | Args: |
| 54 | test_name: Name of the test (from extract_test_name) |
| 55 | test_file_path: Relative path to test file (POSIX format) |
| 56 | |
| 57 | Returns: |
| 58 | Category name for this test |
| 59 | """ |
| 60 | # Categorize by directory path (consistent with how all other categories work) |
| 61 | if test_name.startswith("fl_"): |
| 62 | return "fl_tests" |
| 63 | elif test_name.startswith("fx_") or "fx" in test_name: |
| 64 | return "fx_tests" |
| 65 | elif test_file_path.startswith("noise/"): |
| 66 | return "noise_tests" |
| 67 | elif test_file_path.startswith("platforms/"): |
| 68 | return "platform_tests" |
| 69 | |
| 70 | # Default to core tests |
| 71 | return "core_tests" |