diff --git a/test/run_tests.py b/test/run_tests.py index ae9e432ee6f859e369114b1d03246c35cb18498a..f5cd4faa4a8e9c9a0a0a185002848238ff6e814b 100644 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -1,2 +1,46 @@ import pykat +import traceback +import os +class bcolors: + HEADER = '\033[95m' + OKBLUE = '\033[94m' + OKGREEN = '\033[92m' + WARNING = '\033[93m' + FAIL = '\033[91m' + ENDC = '\033[0m' + BOLD = '\033[1m' + UNDERLINE = '\033[4m' + +errors = [] + +print("----------------------------------------------------------------------------------------") + +for path, folders, files in os.walk("./test_scripts"): + + for filename in files: + if filename.endswith(".py"): + filename = os.path.join(path, filename) + + with open(filename) as f: + print("RUNNING: " + filename) + try: + code = compile(f.read(), filename, 'exec') + exec(code) + except Exception as ex: + print(bcolors.FAIL) + print("EXCEPTION: " + repr(ex)) + traceback.print_exc() + errors.append(filename) + print(bcolors.ENDC) + + print("----------------------------------------------------------------------------------------") + + +if len(errors) > 0: + print("\nFAILED !!!\n") + print("The following files failed: ") + for e in errors: + print(" - " + e) +else: + print("\nPASSED\n") \ No newline at end of file diff --git a/test/test_scripts/structural/test_properties.py b/test/test_scripts/structural/test_properties.py index 2bacda37a5c13ddca99837bb96bb784a5d9cbbbf..a388a6d6e0439691bdd978bab6cc778aa890c4e2 100644 --- a/test/test_scripts/structural/test_properties.py +++ b/test/test_scripts/structural/test_properties.py @@ -14,7 +14,7 @@ kat.pdr.f1 = "0.1k" assert(kat.pdr.f1 == 100) assert(type(kat.pdr.f1) is pykat.param.Param) -kat.pdr.phi1 = "10u" +kat.pdr.phase1 = "10u" assert(kat.pdr.phase1 == 1e-5) assert(type(kat.pdr.phase1) is pykat.param.Param)