Files
PS5_RetroArch/tests/test_optional_core_metadata.py
Jorge Feitosa c1ed6e5a2a Optional SwanStation core (PS5_WITH_SWANSTATION=1)
From mihawk-99/PS5_RetroArch#54 (Jorge Feitosa). tools/build-swanstation.sh
builds libretro/swanstation at a pinned revision (archive SHA-256 checked)
as a native shared core: Vulkan, the x64 recompiler on title executable
memory (ps5_exec_allocate) with LUT fastmem instead of the mmap path.
The platform changes are adapted from AngelXex's SwanStationPS5 1.3.4,
credited in the patch, the README and the notices. A title build stages it
only with PS5_WITH_SWANSTATION=1, with its licence file beside the info
file; Beetle PSX HW stays the PlayStation default, and the WebUI catalog
lists its options when it is staged.

Changed from the pull request: tooling/swanstation/README.md no longer
names the game it was tested with.

Evidence: tools/build-swanstation.sh, core ABI PASS (25 exports,
kernel_web, sha256 dfb1521f...); tests/test_optional_core_metadata.py
(catalog with and without the core). A title built with
PS5_WITH_SWANSTATION=1: 60 notice parts, check-notices covers every
shipped executable, check-manifest PASS, 113 SwanStation options in the
catalog. Gates (default build): format, unit (201), build (staged cores
reused), integration, evidence PASS. Console: with this series' deploy.
2026-10-17 21:06:25 -04:00

31 lines
1.2 KiB
Python

"""The metadata generator must import with the optional core both off and on."""
import importlib.util
import os
from pathlib import Path
import unittest
from unittest.mock import patch
ROOT = Path(__file__).resolve().parent.parent
def catalogs(environment):
with patch.dict(os.environ, environment, clear=True):
spec = importlib.util.spec_from_file_location(
'optional_metadata', ROOT / 'tools/generate-core-metadata.py')
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module.CORES
class OptionalCoreMetadata(unittest.TestCase):
def test_default_catalog_excludes_swanstation(self):
self.assertNotIn('swanstation', [core[0] for core in catalogs({})])
def test_enabled_catalog_registers_swanstation_once(self):
cores = catalogs({'PS5_WITH_SWANSTATION': '1'})
enabled = [core for core in cores if core[0] == 'swanstation']
self.assertEqual(len(enabled), 1)
self.assertEqual(enabled[0][1], 'SwanStation')
self.assertEqual(enabled[0][2],
'build/cores/swanstation/source/src/libretro/libretro_core_options.h')