From 0bd2e4cb90f9b58edbf9f0984dbcd493fc9db4d5 Mon Sep 17 00:00:00 2001 From: boykopovar Date: Sat, 10 Oct 2026 15:31:17 +0300 Subject: [PATCH] test(relinker): align module tests with nonrecursive discovery --- .../tests/test_guest_module_identity.py | 36 +++---- .../tests/test_guest_needed_modules.py | 25 +++-- .../tests/test_guest_needed_nested_modules.py | 97 ++++--------------- .../relinker/tests/test_guest_runpath.py | 2 +- .../tests/test_linux_load_alignment.py | 4 +- 5 files changed, 53 insertions(+), 111 deletions(-) diff --git a/core/relinker/relinker/tests/test_guest_module_identity.py b/core/relinker/relinker/tests/test_guest_module_identity.py index 8e542e72b..211b7a6cc 100644 --- a/core/relinker/relinker/tests/test_guest_module_identity.py +++ b/core/relinker/relinker/tests/test_guest_module_identity.py @@ -71,7 +71,7 @@ def main(): assert result.returncode == expected, (result.returncode, result.stdout, result.stderr) for windows in (True, False): - for directory in ('sce_module', '.', 'Media/Modules'): + for directory in ('sce_module', 'prx'): result, output = convert(f'sprx-request-{windows}-{directory.replace("/", "-")}', windows, 'libGuest.sprx', module_directory=directory, guest_request='libGuest.sprx', providers={'renamed.sprx': declared_provider(22, ('libGuest',))}) @@ -95,22 +95,18 @@ def main(): extra={'unused.prx': declared_provider(77, ('libUnused',)), 'opaque.sprx': b'not an ELF'}) assert result.returncode == 0, result.stderr artifact = output.parent / 'app0' / (relative.as_posix() + '.guest.prx') - assert artifact.is_file(), list((output.parent / 'app0').rglob('*')) - assert len(list((output.parent / 'app0').rglob('*.guest.prx'))) == 2 - if windows: - run(output) - else: - assert needed_libraries(output.read_bytes()) == [ - '$ORIGIN/app0/' + directory + '/renamed' + suffix + '.guest.prx', - '$ORIGIN/app0/sce_module/consumer.prx.guest.prx'] + assert not artifact.exists(), artifact + assert len(list((output.parent / 'app0').rglob('*.guest.prx'))) == 1 + if not windows: + assert 'libGuest.suprx' in needed_libraries(output.read_bytes()) result, output = convert(f'outside-ambiguous-{windows}', windows, 'libGuest.suprx', module_directory='.', providers={'one.prx': declared_provider(22, ('libGuest',))}, extra={'other/two.prx': declared_provider(33, ('libGuest',))}) - assert result.returncode == 2 and 'Ambiguous needed module identity' in result.stderr, result.stderr - assert not output.exists() + assert result.returncode == 0, result.stderr + assert not list((output.parent / 'app0').rglob('*.guest.prx')) - result, output = convert(f'outside-sce-strings-{windows}', windows, 'libGuest.suprx', module_directory='.', + result, output = convert(f'sce-strings-{windows}', windows, 'libGuest.suprx', module_directory='sce_module', providers={'renamed.prx': sce_strings(declared_provider(22, ('libGuest',)))}) assert result.returncode == 0, result.stderr if windows: @@ -128,22 +124,22 @@ def main(): malformed = declared_provider(22, ('libGuest',)) struct.pack_into('