From 5175b0da3a78c96f61812eb82b7f458cb912751e Mon Sep 17 00:00:00 2001 From: "Magomed Kostoev (mkostoevr)" Date: Fri, 26 Nov 2021 21:38:46 +0000 Subject: [PATCH] [KERNEL][TEST] Prepare for multithreading git-svn-id: svn://kolibrios.org@9322 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/runtests.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/kernel/trunk/runtests.py b/kernel/trunk/runtests.py index b8ed3eed79..59d72e7481 100755 --- a/kernel/trunk/runtests.py +++ b/kernel/trunk/runtests.py @@ -10,6 +10,7 @@ from shutil import which import timeit import urllib.request import subprocess +from threading import Thread sys.path.append('test') import common @@ -130,18 +131,7 @@ def collect_tests(): tests.append(test_folder_path) return tests -if __name__ == "__main__": - root_dir = os.getcwd() - - # Check available tools - tools = (("qemu-system-i386", "qemu-system-x86"), - ("fasm", "fasm")) - check_tools(tools) - - prepare_test_img() - tests = collect_tests() - - # Execute each test +def run_tests_serially(tests, root_dir): test_number = 1 for test in tests: test_dir = f"{root_dir}/{test}" @@ -162,4 +152,15 @@ if __name__ == "__main__": os.chdir(root_dir) test_number += 1 + +if __name__ == "__main__": + root_dir = os.getcwd() + + # Check available tools + tools = (("qemu-system-i386", "qemu-system-x86"), + ("fasm", "fasm")) + check_tools(tools) + prepare_test_img() + tests = collect_tests() + run_tests_serially(tests, root_dir)