Skip to content
Snippets Groups Projects
Commit 2ee4f923 authored by Daniel Brown's avatar Daniel Brown
Browse files

updating test script

parent 0c21a8ff
No related branches found
No related tags found
No related merge requests found
import pykat 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
...@@ -14,7 +14,7 @@ kat.pdr.f1 = "0.1k" ...@@ -14,7 +14,7 @@ kat.pdr.f1 = "0.1k"
assert(kat.pdr.f1 == 100) assert(kat.pdr.f1 == 100)
assert(type(kat.pdr.f1) is pykat.param.Param) assert(type(kat.pdr.f1) is pykat.param.Param)
kat.pdr.phi1 = "10u" kat.pdr.phase1 = "10u"
assert(kat.pdr.phase1 == 1e-5) assert(kat.pdr.phase1 == 1e-5)
assert(type(kat.pdr.phase1) is pykat.param.Param) assert(type(kat.pdr.phase1) is pykat.param.Param)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment