mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-01 15:43:45 -06:00
fix: fold region runs on the emulator page
Twelve region records made the Beetle Saturn Tested block 266 words where the page allows 120. A region run reads as one outcome per game on the system page, so the emulator page now names them in one line.
This commit is contained in:
1 parent
5be7ee0760
commit
6bbf0f137c
2 files changed
+25
No files matched your search
@@ -403,6 +403,8 @@ def site_region_results(root: Path = ROOT, repo: str = REPO) -> list[dict]:
|
||||
return region_results(root, stored, source)
|
||||
|
||||
|
||||
REGION_SUBJECT = re.compile(r"^region-[a-z0-9_]+-[a-z0-9-]+-(full|own|others|pack)$")
|
||||
|
||||
VARIANT_WORDS = {"full": "every regional BIOS", "own": "its own region's BIOS only",
|
||||
"others": "the other regions' BIOS only", "pack": "the region's pack"}
|
||||
|
||||
@@ -1047,6 +1049,10 @@ def tested_section(name: str, items: list[dict]) -> list[str]:
|
||||
f'<a href="{markup.site_href(f"downloads/measurements/{name}.sqlite")}">SQLite</a>')
|
||||
ordered = sorted(items, key=lambda i: (i["date"], i["subject"], core_label(i)), reverse=True)
|
||||
benches = [i for i in ordered if i["kind"] == "bench"]
|
||||
# The region runs (region_check.py) read as one outcome per game, on the
|
||||
# system page: listed here they would be a row per run.
|
||||
regional = [i for i in ordered if i["kind"] != "bench" and REGION_SUBJECT.match(i["subject"])]
|
||||
ordered = [i for i in ordered if i not in regional]
|
||||
earlier = [i for i in ordered if i["kind"] != "bench" and folded(i)]
|
||||
current = [i for i in ordered if i["kind"] != "bench" and not folded(i)]
|
||||
lines = ["## Tested", "", '<div class="rb-tested">',
|
||||
@@ -1075,6 +1081,10 @@ def tested_section(name: str, items: list[dict]) -> list[str]:
|
||||
title = f"{file}, {titles[item['id']]}" if file else titles[item["id"]]
|
||||
lines += _row(item, title, page_host, main_core)
|
||||
lines.append("</details>")
|
||||
if regional:
|
||||
games = len({i["content"] for i in regional})
|
||||
lines.append(f'<p class="rb-tested-file">Region check: {len(regional)} runs of '
|
||||
f"{games} game{'s' if games != 1 else ''}, read on the system page.</p>")
|
||||
if benches:
|
||||
# One line: MDX reads a table split over lines as paragraphs.
|
||||
table = ['<table class="rb-tested-bench"><thead><tr><th>Benchmark</th><th>ms per frame</th>'
|
||||
|
||||
@@ -226,6 +226,21 @@ class SitePages(unittest.TestCase):
|
||||
self.assertNotIn("reference frames are recorded", text)
|
||||
self.assertEqual(sm.region_section([]), [])
|
||||
|
||||
def test_the_emulator_page_folds_region_runs_into_one_line(self) -> None:
|
||||
import measurement_records as mr
|
||||
import sitemeasurements as sm
|
||||
|
||||
stored = mr.read_records(ROOT)
|
||||
index = sm.build_index(stored, {"repo": sm.REPO, "commit": "0" * 40}, sm.load_profiles(ROOT / "emulators"))
|
||||
items = sm.by_emulator(index).get("beetle_psx") or []
|
||||
regional = [i for i in items if sm.REGION_SUBJECT.match(i["subject"])]
|
||||
if not regional:
|
||||
self.skipTest("no region record")
|
||||
text = "\n".join(sm.tested_section("beetle_psx", items))
|
||||
self.assertIn(f"Region check: {len(regional)} runs of 3 games, read on the system page.", text)
|
||||
for item in regional:
|
||||
self.assertNotIn(item["record_url"], text)
|
||||
|
||||
def test_coverage_names_tested_and_uncovered_systems(self) -> None:
|
||||
import sitemeasurements as sm
|
||||
|
||||
|
||||
Reference in new issue
Block a user