From dfaa30ff46b733f779b295c3c73ae1a2d50e9e21 Mon Sep 17 00:00:00 2001 From: starnakin Date: Wed, 17 Dec 2025 05:58:46 -0600 Subject: [PATCH] add: multithreaded tests --- test/parsing.py | 6 ++++-- test/thread_manager.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/parsing.py b/test/parsing.py index 511024a..bea3567 100644 --- a/test/parsing.py +++ b/test/parsing.py @@ -19,6 +19,8 @@ def _test(title: str, excutable: str, args: str, exit_code: int, log_path: str) def test_parsing(excutable: str, tests_category: dict[str, list[dict[str, str]]], log_path: str): for category_name, tests in tests_category.items(): - print(category_name, end="\n" * 2) + print(category_name) for test in tests: - thread_manager.add_to_queu(_test, (test["title"], excutable, test['args'], test['exit'], f"{log_path}/{category_name}")) \ No newline at end of file + thread_manager.add_to_queu(_test, (test["title"], excutable, test['args'], test['exit'], f"{log_path}/{category_name}")) + thread_manager.wait_pool() + print("\n" * 1) \ No newline at end of file diff --git a/test/thread_manager.py b/test/thread_manager.py index 546ef3f..345830a 100644 --- a/test/thread_manager.py +++ b/test/thread_manager.py @@ -8,4 +8,5 @@ def add_to_queu(func: callable, args: tuple): def wait_pool(): global _pool - _pool.shutdown(wait=True) \ No newline at end of file + _pool.shutdown(wait=True) + _pool = concurrent.futures.ThreadPoolExecutor(max_workers=10) \ No newline at end of file