add: python tester
This commit is contained in:
24
test/test.py
Normal file
24
test/test.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from collections.abc import Callable
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
import shutil
|
||||
|
||||
import thread_manager
|
||||
import parsing
|
||||
import exectution
|
||||
|
||||
excutable: str = sys.argv[1]
|
||||
|
||||
with open('test/tests.json', 'r') as file:
|
||||
tests: dict[str, dict] = json.load(file)
|
||||
|
||||
tester: dict[str, Callable[[str, dict], None]] = {"parsing": parsing.test_parsing, "excution": exectution.test_excution}
|
||||
|
||||
shutil.rmtree("log")
|
||||
|
||||
for category_name, tests in tests.items():
|
||||
print(category_name, end="\n" * 3)
|
||||
tester[category_name](excutable, tests, f"log/{category_name}")
|
||||
thread_manager.wait_pool()
|
||||
|
||||
Reference in New Issue
Block a user