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
2bec02d8
Commit
2bec02d8
authored
Nov 09, 2013
by
Daniel Brown
Browse files
changing exception case
parent
82cfc3e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
pykat/testing/test.py
View file @
2bec02d8
...
...
@@ -27,50 +27,55 @@ def initProcess(dkats):
done_kats
=
dkats
def
run_kat_file
(
item
):
#print os.getpid(),"getting kat...",item["kat"]
global
done_kats
kat
=
item
[
"kat"
]
suite
=
item
[
"suite"
]
FINESSE_EXE
=
item
[
"FINESSE_EXE"
]
SUITE_PATH
=
item
[
"SUITE_PATH"
]
SUITE_OUTPUT_DIR
=
item
[
"SUITE_OUTPUT_DIR"
]
basename
=
os
.
path
.
splitext
(
kat
)[
0
]
if
item
[
"run_fast"
]
and
(
'map '
in
open
(
kat
).
read
()):
print
"skipping "
+
kat
else
:
exp
=
None
try
:
#print os.getpid(),"getting kat...",item["kat"]
global
done_kats
try
:
start
=
time
.
time
()
out
,
err
=
utils
.
runcmd
([
FINESSE_EXE
,
"--noheader"
,
kat
],
cwd
=
SUITE_PATH
)
OUT_FILE
=
os
.
path
.
join
(
SUITE_PATH
,
basename
+
".out"
)
LOG_FILE
=
os
.
path
.
join
(
SUITE_PATH
,
basename
+
".log"
)
f_in
=
open
(
LOG_FILE
,
'rb'
)
f_out
=
gzip
.
open
(
LOG_FILE
+
".gz"
,
'wb'
)
f_out
.
writelines
(
f_in
)
f_out
.
close
()
f_in
.
close
()
shutil
.
move
(
OUT_FILE
,
SUITE_OUTPUT_DIR
)
shutil
.
move
(
LOG_FILE
+
".gz"
,
SUITE_OUTPUT_DIR
)
except
utils
.
RunException
as
e
:
FINESSE_EXE
=
item
[
"FINESSE_EXE"
]
SUITE_PATH
=
item
[
"SUITE_PATH"
]
SUITE_OUTPUT_DIR
=
item
[
"SUITE_OUTPUT_DIR"
]
basename
=
os
.
path
.
splitext
(
kat
)[
0
]
print
"STDERR: "
+
e
.
out
print
"STDOUT: "
+
e
.
err
if
item
[
"run_fast"
]
and
(
'map '
in
open
(
kat
).
read
()):
print
"skipping "
+
kat
else
:
exp
=
None
print
"Error running "
+
kat
+
": "
+
e
.
err
try
:
start
=
time
.
time
()
out
,
err
=
utils
.
runcmd
([
FINESSE_EXE
,
"--noheader"
,
kat
],
cwd
=
SUITE_PATH
)
OUT_FILE
=
os
.
path
.
join
(
SUITE_PATH
,
basename
+
".out"
)
LOG_FILE
=
os
.
path
.
join
(
SUITE_PATH
,
basename
+
".log"
)
f_in
=
open
(
LOG_FILE
,
'rb'
)
f_out
=
gzip
.
open
(
LOG_FILE
+
".gz"
,
'wb'
)
f_out
.
writelines
(
f_in
)
f_out
.
close
()
f_in
.
close
()
shutil
.
move
(
OUT_FILE
,
SUITE_OUTPUT_DIR
)
shutil
.
move
(
LOG_FILE
+
".gz"
,
SUITE_OUTPUT_DIR
)
except
utils
.
RunException
as
e
:
exp
=
e
finally
:
done_kats
.
value
+=
1
return
[
time
.
time
()
-
start
,
suite
,
kat
,
exp
]
print
"STDERR: "
+
e
.
out
print
"STDOUT: "
+
e
.
err
print
"Error running "
+
kat
+
": "
+
e
.
err
exp
=
e
finally
:
done_kats
.
value
+=
1
return
[
time
.
time
()
-
start
,
suite
,
kat
,
exp
]
except
Exception
as
e
:
print
"main error in kat call"
,
e
return
[
0
,
suite
,
kat
,
NULL
]
class
DiffException
(
Exception
):
def
__init__
(
self
,
msg
,
outfile
):
...
...
Write
Preview
Supports
Markdown
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