Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Production Test Suite
Commits
54f4dc7d
Commit
54f4dc7d
authored
May 17, 2011
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tps: fix several trivial bugs
parent
43b3c95e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
8 deletions
+25
-8
tps.py
tps.py
+25
-8
No files found.
tps.py
View file @
54f4dc7d
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
import
sys
import
sys
import
cmd
import
cmd
import
glob
import
os
,
os
.
path
import
os
,
os
.
path
import
datetime
import
datetime
...
@@ -23,21 +24,36 @@ class Suite(object):
...
@@ -23,21 +24,36 @@ class Suite(object):
def
run
(
self
):
def
run
(
self
):
ts
=
timestamp
()
ts
=
timestamp
()
test_glob
=
os
.
path
.
join
(
self
.
path
,
self
.
pattern
,
'.py'
)
test_glob
=
os
.
path
.
join
(
self
.
path
,
self
.
pattern
+
'.py'
)
sequence
=
glob
.
glob
(
test_glob
)
sequence
=
glob
.
glob
(
test_glob
)
if
self
.
path
not
in
sys
.
path
:
sys
.
path
.
append
(
self
.
path
)
for
test
in
sequence
:
for
test
in
sequence
:
testname
,
ext
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
test
))
try
:
try
:
name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
test
))
mod
=
__import__
(
testname
,
globals
(),
locals
(),
[
'main'
])
__import__
(
name
,
globals
(),
locals
(),
[
'main'
])
mod
.
main
()
name
()
except
TpsCritical
,
e
:
except
TpsCritical
,
e
:
print
'Tps Critical error, aborting: [
%
s]'
%
e
.
valu
e
print
'Tps Critical error, aborting: [
%
s]'
%
e
.
messag
e
break
break
except
TpsError
,
e
:
except
TpsError
,
e
:
print
'Tps Error error, continuing: [
%
s]'
%
e
.
value
print
'Tps Error error, continuing: [
%
s]'
%
e
.
message
except
TpsUser
,
e
:
print
'Tps User error, user intervention required: [
%
s]'
%
e
.
message
print
'Error
%
s found in test named
%
s. '
,
while
True
:
ans
=
raw_input
(
'Abort or Continue? (A/C) '
)
ans
=
ans
.
lower
()
if
ans
in
(
'a'
,
'c'
):
break
if
ans
==
'a'
:
break
elif
ans
==
'c'
:
continue
except
TpsWarning
,
e
:
except
TpsWarning
,
e
:
print
'Tps Warning: [
%
s]'
%
e
.
valu
e
print
'Tps Warning: [
%
s]'
%
e
.
messag
e
finally
:
finally
:
print
'ran test '
,
test
pass
pass
def
write_cfg
(
self
):
def
write_cfg
(
self
):
...
@@ -84,3 +100,4 @@ if __name__ == '__main__':
...
@@ -84,3 +100,4 @@ if __name__ == '__main__':
s
=
Suite
(
options
.
config
)
s
=
Suite
(
options
.
config
)
s
.
write_cfg
()
s
.
write_cfg
()
s
.
run
()
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