mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-19 03:59:45 +00:00
Cleaning
This commit is contained in:
parent
f6fc8a4c86
commit
c73ebc1fbc
2 changed files with 11 additions and 11 deletions
12
tests/run.py
12
tests/run.py
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os, subprocess, time,sys
|
||||
import os,subprocess,time,sys
|
||||
|
||||
##### Setup Variables
|
||||
##### Setup variables
|
||||
tests_timeout=20 # Max duration of a test
|
||||
tests_path = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
##### Run All Tests
|
||||
##### Run all tests
|
||||
for file in os.listdir(tests_path):
|
||||
current_test_path=os.path.join(tests_path,file)
|
||||
if os.path.isdir(current_test_path):
|
||||
|
@ -15,7 +15,7 @@ for file in os.listdir(tests_path):
|
|||
print("- %-40s%s " % (file,"=>"),end='')
|
||||
try:
|
||||
start_at=time.time()
|
||||
out=subprocess.check_output([sys.executable, simulator_path], stderr=subprocess.STDOUT,timeout=tests_timeout,encoding="utf-8")
|
||||
out=subprocess.check_output([sys.executable, simulator_path],stderr=subprocess.STDOUT,timeout=tests_timeout,encoding="utf-8")
|
||||
out_expected=open(out_path).read()
|
||||
end_at=time.time()
|
||||
if out_expected != out:
|
||||
|
@ -28,12 +28,12 @@ for file in os.listdir(tests_path):
|
|||
print("passed (%0.1fs)"%(end_at-start_at))
|
||||
except subprocess.TimeoutExpired as err:
|
||||
print("failed :(")
|
||||
print("------------- Test timeout (should not exceed "+str(tests_timeout)+"s) -------------")
|
||||
print("------------- Test duration expired (timeout="+str(tests_timeout)+"s) -------------")
|
||||
print(err.output,end="")
|
||||
exit(1)
|
||||
except subprocess.CalledProcessError as err:
|
||||
print("failed :(")
|
||||
print("------------- Non test has a non-zero exit code -------------")
|
||||
print("------------- Test has a non-zero exit code -------------")
|
||||
print(err.output,end="")
|
||||
exit(2)
|
||||
except Exception as err:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue