From 904c78d4e44c8d2f24777f44bcb664a1f51786d1 Mon Sep 17 00:00:00 2001 From: "Magomed Kostoev (mkostoevr)" Date: Fri, 3 Dec 2021 15:52:30 +0000 Subject: [PATCH] [KERNEL][TEST] Use python library instead of custom function git-svn-id: svn://kolibrios.org@9369 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/test/common/__init__.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/kernel/trunk/test/common/__init__.py b/kernel/trunk/test/common/__init__.py index 1b2455e44d..3379710144 100644 --- a/kernel/trunk/test/common/__init__.py +++ b/kernel/trunk/test/common/__init__.py @@ -77,16 +77,6 @@ class Qemu: def wait(self, seconds = 0.25): time.sleep(seconds) -def get_file_directory(path): - path = path.replace("\\", "/") - if "/" in path: - folder = "/".join(path.split("/")[:-1]) - if folder == "": - return "/" # It was a file in the root folder - return folder - else: - return "." # Just a filename, let's return current folder - def run_qemu(root_dir, test_dir, debug_log): # Make local copy of IMG, so we will be able to run the test in parallel if os.path.exists(f"{test_dir}/kolibri_test.img"): # If previous test run interrupted the file may be busy @@ -104,7 +94,7 @@ def run_qemu(root_dir, test_dir, debug_log): flags += "-soundhw ac97 " if is_win32(): qemu_full_path = shutil.which(qemu_command) - qemu_directory = get_file_directory(qemu_full_path) + qemu_directory = os.path.dirname(qemu_full_path) flags += f"-L {qemu_directory} " s = f"{qemu_command} {flags}" qemu_stdout = open(f"{test_dir}/qemu_stdout.log", "w")