mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-01 13:58:55 -06:00
fix: give retropie modules the platform name flag
This commit is contained in:
1 parent
b80fc1919d
commit
0f602d5914
7 files changed
+68
-66
No files matched your search
@@ -24,7 +24,7 @@ from scraper.romfolders import (
|
||||
scrape_setup,
|
||||
)
|
||||
from scraper.romfolders.__main__ import dump_setup
|
||||
from scraper.romfolders.es import _module_valid
|
||||
from scraper.retropie_modules import module_enabled
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
|
||||
@@ -300,7 +300,7 @@ class RetroPieFormat(unittest.TestCase):
|
||||
self.rows = by_folder(scrape("retropie", "retropie", {
|
||||
"platforms_cfg": "platforms.cfg", "module_dirs": ["emulators", "libretrocores"],
|
||||
"install_sections": ["core", "main", "opt", "exp"],
|
||||
"platform_flags": ["native", "64bit", "gl", "vulkan", "x11", "x86"]}))
|
||||
"platform": "x86_64"}))
|
||||
|
||||
def test_folders_and_loop_systems(self) -> None:
|
||||
self.assertEqual(sorted(self.rows), ["nes", "psx", "vectrex"])
|
||||
@@ -314,10 +314,10 @@ class RetroPieFormat(unittest.TestCase):
|
||||
|
||||
def test_module_flags_read_in_order(self) -> None:
|
||||
x86 = {"x86", "64bit"}
|
||||
self.assertFalse(_module_valid(["!all"], x86))
|
||||
self.assertTrue(_module_valid(["!all", "x86"], x86))
|
||||
self.assertFalse(_module_valid(["!x86"], x86))
|
||||
self.assertTrue(_module_valid(["!arm"], x86))
|
||||
self.assertFalse(module_enabled(["!all"], x86))
|
||||
self.assertTrue(module_enabled(["!all", "x86"], x86))
|
||||
self.assertFalse(module_enabled(["!x86"], x86))
|
||||
self.assertTrue(module_enabled(["!arm"], x86))
|
||||
|
||||
|
||||
class Determinism(unittest.TestCase):
|
||||
|
||||
@@ -19,6 +19,7 @@ import urllib.error
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
from scripts.scraper.retropie_modules import PLATFORM_FLAGS, module_enabled
|
||||
from scripts.scraper.targets import (
|
||||
batocera_targets_scraper,
|
||||
emudeck_targets_scraper,
|
||||
@@ -643,7 +644,9 @@ class RetroPieModuleFlags(unittest.TestCase):
|
||||
"""
|
||||
|
||||
def test_flags_follow_rp_register_module(self):
|
||||
available = retropie_targets_scraper._is_available
|
||||
def available(flags: str, platform: str) -> bool:
|
||||
return module_enabled(flags.split(), PLATFORM_FLAGS[platform])
|
||||
|
||||
cases = {
|
||||
("sdl1 !mali", "rpi4"): True,
|
||||
("!all videocore", "rpi3"): True,
|
||||
@@ -653,6 +656,10 @@ class RetroPieModuleFlags(unittest.TestCase):
|
||||
("!all x86", "rpi4"): False,
|
||||
("!all x86", "x86_64"): True,
|
||||
("!all arm rpi3 rpi4 rpi5 x86", "rpi1"): True,
|
||||
# system.sh:541 puts the platform name first: redream.sh
|
||||
# declares `!all gles31 aarch64 x86_64` and runs on a PC.
|
||||
("noinstclean !all gles31 aarch64 x86_64", "x86_64"): True,
|
||||
("noinstclean !all gles31 aarch64 x86_64", "x86"): False,
|
||||
}
|
||||
for (flags, platform), expected in cases.items():
|
||||
with self.subTest(flags=flags, platform=platform):
|
||||
|
||||
Reference in new issue
Block a user