Skip to content

Commit

Permalink
[TEST.py] integrationg failed and sucess display
Browse files Browse the repository at this point in the history
  • Loading branch information
Cr0a3 committed Sep 14, 2024
1 parent 7842f3e commit 7a5acfc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from base64 import decode
import glob
from colorama import init, Fore, Style
import subprocess
Expand All @@ -11,13 +12,15 @@
passed = 0

for test in tests:
process = subprocess.run(["cargo", "run", "-p", "ytest", "--", f"-t={test}"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
process = subprocess.run(["cargo", "run", "-p", "ytest", "--", f"-t={test}"], capture_output=True)
if process.returncode == 0:
print(Fore.GREEN + test + Style.RESET_ALL)
print(Fore.GREEN + "SUCESS " + test + Style.RESET_ALL)
passed += 1
else:
failed += 1
print(Fore.RED + test + Style.RESET_ALL)
print(Fore.RED + "==== FAILED " + test + " ====" + Style.RESET_ALL)
print(process.stdout.decode())
print(process.stdout.decode())

print(
Fore.GREEN + str(passed) + Style.RESET_ALL +
Expand Down

0 comments on commit 7a5acfc

Please sign in to comment.