[KERNEL][TEST] Run serial tests in separated thread

git-svn-id: svn://kolibrios.org@9323 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Magomed Kostoev (mkostoevr) 2021-11-26 21:56:18 +00:00
parent 5175b0da3a
commit 5971fdb186

View File

@ -131,7 +131,7 @@ def collect_tests():
tests.append(test_folder_path) tests.append(test_folder_path)
return tests return tests
def run_tests_serially(tests, root_dir): def run_tests_serially_thread(test, root_dir):
test_number = 1 test_number = 1
for test in tests: for test in tests:
test_dir = f"{root_dir}/{test}" test_dir = f"{root_dir}/{test}"
@ -153,6 +153,11 @@ def run_tests_serially(tests, root_dir):
test_number += 1 test_number += 1
def run_tests_serially(tests, root_dir):
thread = Thread(target = run_tests_serially_thread, args = (tests, root_dir))
thread.start()
return thread
if __name__ == "__main__": if __name__ == "__main__":
root_dir = os.getcwd() root_dir = os.getcwd()
@ -163,4 +168,6 @@ if __name__ == "__main__":
prepare_test_img() prepare_test_img()
tests = collect_tests() tests = collect_tests()
run_tests_serially(tests, root_dir) serial_executor_thread = run_tests_serially(tests, root_dir)
serial_executor_thread.join()