Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
2ee4f923
Commit
2ee4f923
authored
Apr 28, 2016
by
Daniel Brown
Browse files
updating test script
parent
0c21a8ff
Pipeline
#831
passed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/run_tests.py
View file @
2ee4f923
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
(
"
\n
FAILED !!!
\n
"
)
print
(
"The following files failed: "
)
for
e
in
errors
:
print
(
" - "
+
e
)
else
:
print
(
"
\n
PASSED
\n
"
)
\ No newline at end of file
test/test_scripts/structural/test_properties.py
View file @
2ee4f923
...
...
@@ -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
.
ph
i
1
=
"10u"
kat
.
pdr
.
ph
ase
1
=
"10u"
assert
(
kat
.
pdr
.
phase1
==
1e-5
)
assert
(
type
(
kat
.
pdr
.
phase1
)
is
pykat
.
param
.
Param
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment