From 02941b8e3f719fbcacd672f5c48074c3de5ebb07 Mon Sep 17 00:00:00 2001 From: MarcZX100 Date: Sat, 10 Oct 2026 19:24:18 +0000 Subject: [PATCH] fix(tools): detect non-void stub wrappers --- tools/progress.py | 2 +- tools/tests/test_progress.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/progress.py b/tools/progress.py index 505c684d7..1b32f8db1 100644 --- a/tools/progress.py +++ b/tools/progress.py @@ -15,7 +15,7 @@ DEFINITION = re.compile(r"\bAPS5_VABI\s+(\w+)\s*\([^;{]*\)\s*(?:noexcept\s*)?(?: STUB = "NotImplemented_nid_no_patch" CMAKE_SHARED = re.compile(r'^\s*include\(\s*"?\$\{CMAKE_CURRENT_SOURCE_DIR\}/\.\./([\w.-]+)/[\w.-]+\.cmake"?\s*\)', re.M) SOURCE_SHARED = re.compile(r'^\s*#\s*include\s*"prx/([\w.-]+)/[\w./-]+\.cpp"', re.M) -STUB_WRAPPER = re.compile(r"\bstatic\s+(?:\[\[noreturn\]\]\s+)?void\s+(\w+)\s*\([^;{]*\)\s*\{") +STUB_WRAPPER = re.compile(r"\bstatic\s+(?:\[\[noreturn\]\]\s+)?[\w:<>,\s*&]+?\s+(\w+)\s*\([^;{]*\)\s*\{") FLAT_SEGMENTS = ("GLOBAL_", "SCRATCH_") OPCODE_SENTINELS = {"Invalid", "Count", "Unknown", "Unsupported"} OPCODE_ALIASES = { diff --git a/tools/tests/test_progress.py b/tools/tests/test_progress.py index ddefe767e..dfff23f69 100644 --- a/tools/tests/test_progress.py +++ b/tools/tests/test_progress.py @@ -9,6 +9,17 @@ import progress class ProgressTests(unittest.TestCase): + def test_nonvoid_stub_wrappers_keep_callers_unimplemented(self): + with tempfile.TemporaryDirectory() as directory: + library = Path(directory) / "libSceExample" + library.mkdir() + (library / "Export.cpp").write_text( + "static int SupportFormat() { NotImplemented_nid_no_patch(__func__); return 0; }\n" + "int APS5_VABI sceExampleSupportFormat() { return SupportFormat(); }\n") + group = progress.scan_library(library) + self.assertEqual(group["done_names"], []) + self.assertEqual(group["todo_names"], ["sceExampleSupportFormat"]) + def test_test_sources_do_not_change_library_progress(self): with tempfile.TemporaryDirectory() as directory: root = Path(directory) / "tests" / "prx"