]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional: Introduce the dso_suffix() helper
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 4 Mar 2025 22:24:16 +0000 (22:24 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 10 Mar 2025 10:30:00 +0000 (10:30 +0000)
Introduce a helper to get the default shared library
suffix used on the host.

Suggested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20250220080215.49165-3-philmd@linaro.org>
[AJB: dropped whitespace cmd.py damage]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20250304222439.2035603-10-alex.bennee@linaro.org>

tests/functional/qemu_test/__init__.py
tests/functional/qemu_test/config.py

index 5c972843a6d05b248b66d0afd7d43498238cf0d9..45f7befa374ae9e069c56e2deec54086f1e72167 100644 (file)
@@ -7,7 +7,7 @@
 
 
 from .asset import Asset
-from .config import BUILD_DIR
+from .config import BUILD_DIR, dso_suffix
 from .cmd import is_readable_executable_file, \
     interrupt_interactive_console_until_pattern, wait_for_console_pattern, \
     exec_command, exec_command_and_wait_for_pattern, get_qemu_img, which
index edd75b7fd06b9d50d0a1dd3cba3a24bfe6240273..6d4c9c3ce1db394d933a751118c03db8d045c00e 100644 (file)
@@ -13,6 +13,7 @@
 
 import os
 from pathlib import Path
+import platform
 
 
 def _source_dir():
@@ -34,3 +35,14 @@ def _build_dir():
     raise Exception("Cannot identify build dir, set QEMU_BUILD_ROOT")
 
 BUILD_DIR = _build_dir()
+
+def dso_suffix():
+    '''Return the dynamic libraries suffix for the current platform'''
+
+    if platform.system() == "Darwin":
+        return "dylib"
+
+    if platform.system() == "Windows":
+        return "dll"
+
+    return "so"