mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 01:53:56 -06:00
fix: a games part is its system's card
Closes every finding of code_audit_23 and tui_audit_16: AmberELEC and EmuELEC cards found as theirs, ArkOS cards told by bgmusic or launchimages, counts that agree and read a copy of the right size before calling it in place, one terminal width, line mode in the screen's order and words, a tap shown armed, and which-pack naming the first screen.
This commit is contained in:
1 parent
27b945ba4c
commit
a4faf536dd
12 files changed
+1257
-254
No files matched your search
+10
-6
@@ -90,12 +90,15 @@ class InstallerOutputExample(unittest.TestCase):
|
||||
intro, run = re.search(r"(?s)\n([^\n]*)\n\n```\n(Fetching file index.*?)```", text).groups()
|
||||
self.assertRegex(intro, r"\d{4}-\d{2}-\d{2}", "an output example says when it was taken")
|
||||
manifest = json.loads((ROOT / "install" / "retroarch.json").read_text(encoding="utf-8"))
|
||||
omitted = re.search(r"Not installable: \d+ files? \(\d+ required, (.*)\)\.", run)
|
||||
# The line as the installer writes it (not_installable_words), or
|
||||
# its earlier "(1 required, not found: 37)" form.
|
||||
omitted = re.search(r"Not installable: \d+ files? (?:\(\d+ required, (.*)\)\.|(?:is|are) "
|
||||
r"not in the collection|.*Why: (.*)\.)", run)
|
||||
if manifest.get("omitted_files"):
|
||||
self.assertIsNotNone(omitted, "the manifest omits files and the run shows no line for it")
|
||||
if omitted:
|
||||
for part in omitted.group(1).split(", "):
|
||||
self.assertIn(part.rsplit(":", 1)[0], install.OMISSION_REASONS.values())
|
||||
if omitted and (omitted.group(1) or omitted.group(2)):
|
||||
for part in (omitted.group(1) or omitted.group(2)).split(", "):
|
||||
self.assertIn(re.split(r":| \(", part)[0], install.OMISSION_REASONS.values())
|
||||
count, size = re.search(r"\n (\d+) files \(([\d.]+ [KMG]B)\)", run).groups()
|
||||
self.assertIn(f"0 in place, {count} missing", run)
|
||||
self.assertSplitAddsUp(run, count, size)
|
||||
@@ -772,11 +775,12 @@ class FirstInstallWalkthrough(unittest.TestCase):
|
||||
self.assertIn(f"Done. {count} files installed", step4)
|
||||
self.assertIn(f"{count} in place, 0 missing", step5)
|
||||
manifest = json.loads((ROOT / "install" / "batocera.json").read_text(encoding="utf-8"))
|
||||
omitted = re.search(r"Not installable: (\d+) files \((\d+) required", step3)
|
||||
omitted = re.search(r"Not installable: (\d+) files (?:\((\d+) required|.*?, (\d+) of them "
|
||||
r"required)", step3)
|
||||
if manifest.get("omitted_files"):
|
||||
self.assertIsNotNone(omitted, "the manifest omits files and the run shows no line for it")
|
||||
if omitted:
|
||||
total, required = map(int, omitted.groups())
|
||||
total, required = int(omitted.group(1)), int(omitted.group(2) or omitted.group(3))
|
||||
first, needed = install._omission_lines(
|
||||
total, [{"required": True, "dest": str(i)} for i in range(required)]
|
||||
)[:2]
|
||||
|
||||
Reference in new issue
Block a user