diff --git a/bios/Microsoft/MSX/SEGA - SF-7000/sf7000.rom b/bios/Sega/SF-7000/sf7000.rom similarity index 100% rename from bios/Microsoft/MSX/SEGA - SF-7000/sf7000.rom rename to bios/Sega/SF-7000/sf7000.rom diff --git a/tests/test_sega_filing.py b/tests/test_sega_filing.py new file mode 100644 index 00000000..0fd10af1 --- /dev/null +++ b/tests/test_sega_filing.py @@ -0,0 +1,49 @@ +"""Sega ROMs live under bios/Sega. + +The SF-7000 disk unit ROM, which only the sega-sf7000 entries read, sat in +bios/Microsoft/MSX because blueMSX keeps its machine folders together. The +collection files a dump under the maker of the machine it belongs to, and +the blueMSX layout is a destination the pack writes, not a storage rule. +Reads the repository. +""" + +from __future__ import annotations + +import sys +import unittest +from pathlib import Path + +REPO_ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(REPO_ROOT / "scripts")) + + +class SegaFilesStayUnderSega(unittest.TestCase): + def test_no_sega_only_file_under_msx(self): + folder = REPO_ROOT / "bios" / "Microsoft" / "MSX" + if not folder.is_dir(): + self.skipTest("bios/Microsoft/MSX is absent") + from common import load_emulator_profiles + + systems: dict[str, set[str]] = {} + for profile in load_emulator_profiles(str(REPO_ROOT / "emulators")).values(): + for entry in profile.get("files") or []: + if not isinstance(entry, dict) or not entry.get("system"): + continue + for name in [entry.get("name", ""), *(entry.get("aliases") or [])]: + key = Path(str(name)).name.lower() + systems.setdefault(key, set()).add(str(entry["system"])) + misfiled = sorted( + str(path.relative_to(folder)) + for path in folder.rglob("*") + if path.is_file() + and systems.get(path.name.lower()) + and all(s.startswith("sega-") for s in systems[path.name.lower()]) + ) + self.assertEqual(misfiled, []) + + def test_sf7000_rom_is_filed_under_sega(self): + self.assertTrue((REPO_ROOT / "bios" / "Sega" / "SF-7000" / "sf7000.rom").is_file()) + + +if __name__ == "__main__": + unittest.main() diff --git a/wiki/testing-guide.md b/wiki/testing-guide.md index 52742fce..acb64359 100644 --- a/wiki/testing-guide.md +++ b/wiki/testing-guide.md @@ -38,7 +38,7 @@ Every module in `tests/`, by the area it guards. | Area | Fixtures | Modules | |------|----------|---------| | Core regression suites | synthetic | `test_e2e`, `test_audit_regressions`, `test_tool_messages` | -| File resolution and identity | synthetic + collection | `test_adler32_resolution`, `test_agnostic_scan`, `test_agnostic_scan_mode`, `test_agnostic_scope`, `test_agnostic_substitute`, `test_archive_choice`, `test_bios_companions`, `test_bundled_identity`, `test_casefold_cache`, `test_db_aliases`, `test_declared_names`, `test_derivations`, `test_directory_entries`, `test_extra_identity`, `test_foreign_tree`, `test_foreign_tree_names`, `test_frontend_digest`, `test_game_data_homonyms`, `test_hashing`, `test_identity`, `test_md5_pack_context`, `test_name_tiebreak`, `test_nec_filing`, `test_owner_resolution`, `test_path_suffix`, `test_resolution_evidence`, `test_shipped_content`, `test_twin_declarations`, `test_validated_choice`, `test_variant_choice`, `test_variant_identity`, `test_zipped_member` | +| File resolution and identity | synthetic + collection | `test_adler32_resolution`, `test_agnostic_scan`, `test_agnostic_scan_mode`, `test_agnostic_scope`, `test_agnostic_substitute`, `test_archive_choice`, `test_bios_companions`, `test_bundled_identity`, `test_casefold_cache`, `test_db_aliases`, `test_declared_names`, `test_derivations`, `test_directory_entries`, `test_extra_identity`, `test_foreign_tree`, `test_foreign_tree_names`, `test_frontend_digest`, `test_game_data_homonyms`, `test_hashing`, `test_identity`, `test_md5_pack_context`, `test_name_tiebreak`, `test_nec_filing`, `test_owner_resolution`, `test_path_suffix`, `test_resolution_evidence`, `test_sega_filing`, `test_shipped_content`, `test_twin_declarations`, `test_validated_choice`, `test_variant_choice`, `test_variant_identity`, `test_zipped_member` | | Verification, cross-reference and profile checks | synthetic + profiles | `test_crypto_aes`, `test_crypto_unique_data`, `test_crypto_verify`, `test_case_insensitive_platforms`, `test_checks_have_values`, `test_core_file_fills_declaration`, `test_core_size_refusal`, `test_cross_reference_sources`, `test_file_consumers`, `test_fileless_audit`, `test_gap_settlement`, `test_hidden_extras`, `test_launcher_aliases`, `test_launcher_layer`, `test_native_mode`, `test_no_case_collisions`, `test_path_conflict_status`, `test_path_null_copies`, `test_profile_checks`, `test_profile_repositories`, `test_romm_hash_rule`, `test_shared_groups`, `test_standalone_mode`, `test_undeclared_dedup`, `test_unplaced_extras`, `test_validation_scope`, `test_verify_all_dir`, `test_verify_emulator_evidence`, `test_verify_listing`, `test_verify_pack_choice`, `test_verify_release_asset` | | Packs and manifests | synthetic + real packs | `test_artifact_lock`, `test_atomic_artifacts`, `test_batocera_cores`, `test_deterministic_zip`, `test_emulator_pack_counts`, `test_finalize_pack_names`, `test_large_file_cache`, `test_libretro_layout`, `test_manifest_entry`, `test_pack_conformance_dirs`, `test_pack_core_extras`, `test_pack_counts`, `test_pack_destinations`, `test_pack_failures`, `test_pack_file_names`, `test_pack_grouping`, `test_pack_integrity`, `test_pack_member_identity`, `test_pack_readme`, `test_platform_inheritance`, `test_platform_keys`, `test_required_only_archives`, `test_required_only_twins`, `test_split_extras`, `test_split_names`, `test_split_pack`, `test_system_pack_extras`, `test_system_pack_parity`, `test_torrentzip`, `test_which_pack` | | Slots and regions | synthetic + profiles | `test_region`, `test_region_agnostic_scan`, `test_region_groups`, `test_region_held`, `test_region_platform_index`, `test_region_required_only`, `test_slot`, `test_slots`, `test_slots_shipped_file` |