add readme, move testing function to lib

This commit is contained in:
Joeri Exelmans 2024-11-29 09:53:49 +01:00
parent 2fb8318506
commit 8b3f543bda
5 changed files with 118 additions and 10 deletions

View file

@ -1,5 +1,5 @@
import functools
from lib.test import run_scenario
from lib.test import run_scenarios
# from srcgen.lock_controller import LockController
from srcgen.solution import Solution as LockController # Teacher's solution
@ -229,12 +229,4 @@ INITIAL = [
]
if __name__ == "__main__":
ok = True
for scenario in SCENARIOS:
print(f"Running scenario: {scenario["name"]}")
ok = run_scenario(scenario["input_events"], scenario["output_events"], LockController, INITIAL, IDEMPOTENT, verbose=False) and ok
print("--------")
if ok:
print("All scenarios passed.")
else:
print("Some scenarios failed.")
run_scenarios(SCENARIOS, LockController, INITIAL, IDEMPOTENT)