-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_report.py
More file actions
34 lines (28 loc) · 1.5 KB
/
Copy pathgenerate_report.py
File metadata and controls
34 lines (28 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import subprocess
import sys
def main():
with open("full_report.txt", "w", encoding="utf-8") as f:
f.write("============================================================\n")
f.write(" VAN PROTOCOL SIMULATION — FULL REPORT\n")
f.write("============================================================\n\n")
f.write("=== 1. МОДУЛЬНЫЕ ТЕСТЫ (Криптография, Узлы, Комитет) ===\n")
res1 = subprocess.run([".venv/bin/python3", "-m", "van_sim.tests.test_iteration1"], capture_output=True, text=True)
f.write(res1.stdout)
if res1.stderr:
f.write(res1.stderr)
f.write("\n\n")
f.write("=== 2. СЕТЕВЫЕ ТЕСТЫ И SIMPY (Топология, Маршрутизация, Метрики) ===\n")
res2 = subprocess.run([".venv/bin/python3", "-m", "van_sim.tests.test_iteration2"], capture_output=True, text=True)
f.write(res2.stdout)
if res2.stderr:
f.write(res2.stderr)
f.write("\n\n")
f.write("=== 3. ПРОГОН ПОЛНОЦЕННЫХ СЦЕНАРИЕВ СИМУЛЯЦИИ ===\n")
res3 = subprocess.run([".venv/bin/python3", "main.py", "all"], capture_output=True, text=True)
f.write(res3.stdout)
if res3.stderr:
f.write(res3.stderr)
f.write("\n")
print("Отчет успешно сгенерирован в full_report.txt")
if __name__ == "__main__":
main()