On 19/02/2025 20.23, Philippe Mathieu-Daudé wrote:
Introduce a helper to get the default shared library
suffix used on the host.
Suggested-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
tests/functional/qemu_test/__init__.py | 2 +-
tests/functional/qemu_test/cmd.py | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/functional/qemu_test/__init__.py
b/tests/functional/qemu_test/__init__.py
index 5c972843a6d..e253288ee7f 100644
--- a/tests/functional/qemu_test/__init__.py
+++ b/tests/functional/qemu_test/__init__.py
@@ -8,7 +8,7 @@
from .asset import Asset
from .config import BUILD_DIR
-from .cmd import is_readable_executable_file, \
+from .cmd import is_readable_executable_file, dso_suffix, \
interrupt_interactive_console_until_pattern, wait_for_console_pattern, \
exec_command, exec_command_and_wait_for_pattern, get_qemu_img, which
from .testcase import QemuBaseTest, QemuUserTest, QemuSystemTest
diff --git a/tests/functional/qemu_test/cmd.py
b/tests/functional/qemu_test/cmd.py
index dc5f422b77d..c4704dfb7bc 100644
--- a/tests/functional/qemu_test/cmd.py
+++ b/tests/functional/qemu_test/cmd.py
Maybe config.py would be a better place?
Thomas
@@ -14,6 +14,12 @@
import logging
import os
import os.path
+import platform
+
+def dso_suffix():
+ '''Return the dynamic libraries suffix for the current platform'''
+ DSO_SUFFIXES = { 'Linux': 'so', 'Darwin': 'dylib', 'Windows': 'dll' }
+ return DSO_SUFFIXES[platform.system()]
def which(tool):