mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-12 06:23:23 -05:00
fix: name every narrowed artifact from one list
This commit is contained in:
1 parent
29fcfdef34
commit
23c4dc2aae
5 files changed
+144
-13
No files matched your search
+33
-1
@@ -5917,9 +5917,41 @@ struct BurnDriver BurnDrvneogeo = {
|
||||
'source_tag = {"platform": "_Platform"',
|
||||
'req_suffix = "_required"',
|
||||
'slot_tag = "_OnePerSlot"',
|
||||
# The --system rename kept the region tag alone, the custom pack
|
||||
# took no tag at all, and the skip list retyped four of them.
|
||||
'_Custom_BIOS_Pack.zip"',
|
||||
'{rgn_tag}_BIOS_Pack.zip"',
|
||||
'("_Platform_", "_Truth_"',
|
||||
):
|
||||
self.assertNotIn(hand_rolled, source, hand_rolled)
|
||||
self.assertGreaterEqual(source.count("_narrowings("), 5)
|
||||
self.assertGreaterEqual(source.count("_narrowings("), 8)
|
||||
|
||||
def test_a_narrowed_system_pack_does_not_take_the_full_name(self):
|
||||
"""Every dimension has to show in the filename or two builds collide.
|
||||
|
||||
--system X --required-only produced the same name as --system X and
|
||||
overwrote it, because the rename kept only the region tag.
|
||||
"""
|
||||
import subprocess
|
||||
|
||||
repo = os.path.join(os.path.dirname(__file__), "..")
|
||||
names = {}
|
||||
for label, extra in (("full", []), ("required", ["--required-only"])):
|
||||
out = os.path.join(self.root, f"sysname_{label}")
|
||||
proc = subprocess.run(
|
||||
[sys.executable, "scripts/generate_pack.py", "--system",
|
||||
"atari-lynx", "--offline", *extra, "--output-dir", out],
|
||||
capture_output=True, text=True, cwd=repo, timeout=300,
|
||||
)
|
||||
self.assertEqual(proc.returncode, 0, proc.stdout + proc.stderr)
|
||||
names[label] = sorted(
|
||||
f for f in os.listdir(out) if f.endswith("_BIOS_Pack.zip")
|
||||
)
|
||||
self.assertTrue(names["full"] and names["required"])
|
||||
self.assertNotEqual(
|
||||
names["full"], names["required"],
|
||||
"a required-only system pack took the name of the full one",
|
||||
)
|
||||
|
||||
def test_a_full_pack_is_not_announced_as_narrowed(self):
|
||||
from generate_pack import _build_readme, _narrowings
|
||||
|
||||
@@ -9,6 +9,7 @@ discrepancy that does not exist. Content decides, as everywhere else here.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pathlib
|
||||
import sys
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
@@ -23,6 +24,38 @@ def _entry(name: str, **hashes) -> dict:
|
||||
return {"name": name, **hashes}
|
||||
|
||||
|
||||
class ATargetedModelIsItsOwnArtifact(unittest.TestCase):
|
||||
"""A narrowed truth model must not take the full model's place.
|
||||
|
||||
generate_truth wrote dist/truth/<platform>.yml whatever --target said, so
|
||||
a targeted run overwrote the full model and diff_truth then compared a
|
||||
narrowed model against the whole scrape.
|
||||
"""
|
||||
|
||||
def test_a_target_writes_beside_the_full_model(self):
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
repo = pathlib.Path(__file__).resolve().parent.parent
|
||||
with tempfile.TemporaryDirectory(dir=str(repo / "tmp")) as directory:
|
||||
for extra in ([], ["--target", "browser"]):
|
||||
proc = subprocess.run(
|
||||
[sys.executable, "scripts/generate_truth.py", "--platform",
|
||||
"romm", *extra, "--output-dir", directory],
|
||||
capture_output=True, text=True, cwd=str(repo), timeout=400,
|
||||
)
|
||||
self.assertEqual(proc.returncode, 0, proc.stdout + proc.stderr)
|
||||
produced = sorted(
|
||||
str(p.relative_to(directory))
|
||||
for p in pathlib.Path(directory).rglob("*.yml")
|
||||
)
|
||||
self.assertEqual(
|
||||
produced,
|
||||
["browser/romm.yml", "romm.yml"],
|
||||
"the targeted model did not land beside the full one",
|
||||
)
|
||||
|
||||
|
||||
class RenameMatching(unittest.TestCase):
|
||||
def test_a_shared_sha1_pairs_the_two_names(self):
|
||||
truth = [_entry("bios_CD_U.bin", sha1="a" * 40)]
|
||||
|
||||
Reference in new issue
Block a user