diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-09-02 10:01:16 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-09-02 10:01:16 +0200 |
| commit | c73ebc1fbc4ccae6b2ddcedf529f4f65234bfc33 (patch) | |
| tree | 213d015023224de9e9e49be7f78e76011dde4f90 /tests | |
| parent | f6fc8a4c86fb483c486f4f9f387470fa04d67f66 (diff) | |
Cleaning
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/run.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/run.py b/tests/run.py index 9c21881..0af8d1c 100755 --- a/tests/run.py +++ b/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: |
