Merge pull request #2979 from MarcZX100/fix/progress-nonvoid-stub-wrappers
fix(tools): detect non-void stub wrappers
This commit is contained in:
commit
cf70000356
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue