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")