mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 01:53:56 -06:00
feat: write the romset table from the profiles
The FAQ table of arcade romsets was typed by hand and told readers to collect MAME 0.160 and FinalBurn Neo 1.0.0.2 sets for cores whose source states 0.159 and 1.0.0.03. generate_site now writes it between generated markers from the profiles, and a test holds the page to the generator. An emulator page names where its version is read (the file, the tag and the commits after it, the package), and says when the code states none or the version could not be confirmed. HBMAME no longer claims a MAME romset. tools.md and profiling.md document version_basis and the two modes.
This commit is contained in:
1 parent
69dc4f8077
commit
77a1a7285a
7 files changed
+183
-57
No files matched your search
@@ -790,16 +790,6 @@ class FaqRegressions(unittest.TestCase):
|
||||
existence platform. Readers act on all three.
|
||||
"""
|
||||
|
||||
_MAME_GENERATIONS = {
|
||||
"MAME 2000": "mame2000",
|
||||
"MAME 2003": "mame2003",
|
||||
"MAME 2009": "mame2009",
|
||||
"MAME 2010": "mame2010",
|
||||
"MAME 2015": "mame2015",
|
||||
"MAME 2016": "mame2016",
|
||||
"current MAME": "mame",
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def _faq() -> str:
|
||||
# The questions about hashes and checks moved to the technical FAQ.
|
||||
@@ -813,17 +803,23 @@ class FaqRegressions(unittest.TestCase):
|
||||
with (ROOT / "emulators" / f"{key}.yml").open(encoding="utf-8") as handle:
|
||||
return yaml.safe_load(handle)
|
||||
|
||||
def test_mame_versions_match_their_profiles(self):
|
||||
# The list is wrapped, so a label and its version can straddle a line.
|
||||
faq = " ".join(self._faq().split())
|
||||
for label, key in self._MAME_GENERATIONS.items():
|
||||
match = re.search(rf"{re.escape(label)} \(([^)]+)\)", faq)
|
||||
self.assertIsNotNone(match, f"FAQ no longer states a version for {label}")
|
||||
self.assertEqual(
|
||||
match.group(1),
|
||||
self._profile(key)["core_version"],
|
||||
f"FAQ version for {label} has drifted from emulators/{key}.yml",
|
||||
)
|
||||
def test_the_romset_table_is_written_from_the_profiles(self):
|
||||
# Typed by hand, the table and the prose under it kept MAME 0.160
|
||||
# and FinalBurn Neo 1.0.0.2, versions no source at the pins states,
|
||||
# and the test holding them to the profiles kept the errors in step.
|
||||
sys.path.insert(0, str(ROOT / "scripts"))
|
||||
import generate_site # noqa: PLC0415
|
||||
from common import load_emulator_profiles # noqa: PLC0415
|
||||
|
||||
profiles = load_emulator_profiles(str(ROOT / "emulators"), skip_aliases=False)
|
||||
page = (ROOT / "wiki" / "technical-faq.md").read_text(encoding="utf-8")
|
||||
self.assertEqual(
|
||||
page, generate_site.with_romset_table(page, profiles),
|
||||
"wiki/technical-faq.md romset table is stale: run scripts/generate_site.py",
|
||||
)
|
||||
prose = page.split("### How this is known", 1)[1].split("\n## ", 1)[0]
|
||||
self.assertIsNone(re.search(r"\(0\.\d", prose),
|
||||
"the prose under the table types a version again")
|
||||
|
||||
def test_adler32_is_attributed_to_the_files_that_carry_it(self):
|
||||
dolphin = self._profile("dolphin")
|
||||
|
||||
@@ -86,9 +86,10 @@ class TheHeaderReadsAsWords(unittest.TestCase):
|
||||
self.assertNotIn('rb-badge-muted">japan</span>', self.page)
|
||||
|
||||
def test_profile_version_names_the_pinned_build(self):
|
||||
# DuckStation numbers builds v0.1-<commits since tag 0.1>: the pin,
|
||||
# 4122fed9, is 12,070 commits past it.
|
||||
self.assertRegex(str(_profile("duckstation")["core_version"]), r"^v0\.1-\d+$")
|
||||
# DuckStation tags builds v0.1-<commits since tag 0.1>, and the
|
||||
# pin sits past the last such tag: git describe's form names both.
|
||||
self.assertRegex(str(_profile("duckstation")["core_version"]),
|
||||
r"^v0\.1-\d+(-\d+-g[0-9a-f]{7})?$")
|
||||
|
||||
def test_the_second_spelling_is_a_platform_name(self):
|
||||
# The lookup is case-sensitive and EmuELEC launches "Duckstation":
|
||||
|
||||
@@ -89,7 +89,7 @@ class AnAppThatReadsAnyBios(unittest.TestCase):
|
||||
|
||||
class EveryArcadeCoreNamesItsRomset(unittest.TestCase):
|
||||
def test_finalburn_and_mame_2003_plus(self):
|
||||
for name, romset in (("fbneo", "FinalBurn Neo v1.0.0.2"),
|
||||
for name, romset in (("fbneo", f"FinalBurn Neo {_profile('fbneo')['core_version']}"),
|
||||
("mame2003_plus", "MAME 0.78 (plus backports)")):
|
||||
page = _pages(name)[name]
|
||||
line = page.index(f"Its BIOS and game sets must come from the {romset} romset.")
|
||||
|
||||
Reference in new issue
Block a user