add: multithreaded tests

This commit is contained in:
2025-12-17 05:58:46 -06:00
parent b21881fded
commit dfaa30ff46
2 changed files with 6 additions and 3 deletions

View File

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

View File

@@ -8,4 +8,5 @@ def add_to_queu(func: callable, args: tuple):
def wait_pool():
global _pool
_pool.shutdown(wait=True)
_pool.shutdown(wait=True)
_pool = concurrent.futures.ThreadPoolExecutor(max_workers=10)