Get separate hashes for src/ and tests/ directories. Returns: SplitSourceHashes with src_hash, tests_hash, src_files, and test_files.
(source_dir: Path)
| 255 | |
| 256 | |
| 257 | def get_split_source_hashes(source_dir: Path) -> SplitSourceHashes: |
| 258 | """ |
| 259 | Get separate hashes for src/ and tests/ directories. |
| 260 | |
| 261 | Returns: |
| 262 | SplitSourceHashes with src_hash, tests_hash, src_files, and test_files. |
| 263 | """ |
| 264 | try: |
| 265 | src_files = _discover_files_in_dir(source_dir, "src") |
| 266 | test_files = _discover_files_in_dir(source_dir, "tests") |
| 267 | return SplitSourceHashes( |
| 268 | src_hash=_hash_file_list(src_files), |
| 269 | tests_hash=_hash_file_list(test_files), |
| 270 | src_files=src_files, |
| 271 | test_files=test_files, |
| 272 | ) |
| 273 | except KeyboardInterrupt as ki: |
| 274 | handle_keyboard_interrupt(ki) |
| 275 | raise |
| 276 | except Exception as e: |
| 277 | _ts_print(f"[MESON] Warning: Failed to get source file hashes: {e}") |
| 278 | return SplitSourceHashes( |
| 279 | src_hash="", tests_hash="", src_files=[], test_files=[] |
| 280 | ) |
| 281 | |
| 282 | |
| 283 | def list_all_tests( |
no test coverage detected