fix minor
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 11s

This commit is contained in:
maliakal_d 2025-04-11 17:01:41 +02:00
parent 3e45db2300
commit 0175e2e9d0

View File

@ -128,7 +128,7 @@ def startCmdTests(name, fp, fname):
try: try:
subprocess.run(cmd.split(), stdout=fp, stderr=fp, check=True, text=True) subprocess.run(cmd.split(), stdout=fp, stderr=fp, check=True, text=True)
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
Log(Fore.RED, f'Command failed for {name}:\n{e}') Log(Fore.RED, f'Command tests failed for {name}:\n{e}')
raise raise
with open (fname, 'r') as f: with open (fname, 'r') as f:
@ -143,7 +143,12 @@ def startCmdTests(name, fp, fname):
def startGeneralTests(fp, fname): def startGeneralTests(fp, fname):
Log(Fore.GREEN, 'General Tests') Log(Fore.GREEN, 'General Tests')
cmd = 'tests --abort -s -o ' + fname cmd = 'tests --abort -s -o ' + fname
try:
subprocess.run(cmd.split(), stdout=fp, stderr=fp, check=True, text=True) subprocess.run(cmd.split(), stdout=fp, stderr=fp, check=True, text=True)
except subprocess.CalledProcessError as e:
Log(Fore.RED, f'General tests failed:\n{e}')
raise
with open (fname, 'r') as f: with open (fname, 'r') as f:
for line in f: for line in f:
if "FAILED" in line: if "FAILED" in line:
@ -220,19 +225,19 @@ with open(fname, 'w') as fp:
startCmdTests(server, fp, file_results) startCmdTests(server, fp, file_results)
cleanup(server, fp) cleanup(server, fp)
# redirect to terminal
sys.stdout = original_stdout
sys.stderr = original_stderr
Log(Fore.GREEN, 'Passed all tests for virtual detectors \n' + str(servers))
except Exception as e: except Exception as e:
# redirect to terminal # redirect to terminal
sys.stdout = original_stdout sys.stdout = original_stdout
sys.stderr = original_stderr sys.stderr = original_stderr
Log(Fore.RED, f'Exception caught while testing {server}. Cleaning up...') Log(Fore.RED, f'Exception caught while testing {server}. Cleaning up...')
break break
# redirect to terminal
sys.stdout = original_stdout
sys.stderr = original_stderr
Log(Fore.GREEN, 'Passed all tests for virtual detectors \n' + str(servers))
except Exception as e: except Exception as e:
# redirect to terminal # redirect to terminal
sys.stdout = original_stdout sys.stdout = original_stdout