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
ea87ffc0
Commit
ea87ffc0
authored
May 20, 2011
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tps: no default values assumed, all required params
parent
baaa3aa9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
tps.py
tps.py
+17
-13
No files found.
tps.py
View file @
ea87ffc0
...
...
@@ -15,6 +15,7 @@ from tpsexcept import *
from
pprint
import
pprint
default_config_file
=
'default.cfg'
default_log_pattern
=
'test_
%(board)
s_
%(serial)
s_
%(number)
s_
%(timestamp)
s.txt'
def
run_test
(
testname
,
logname
):
"""run test testname with output redirected to logname
...
...
@@ -31,15 +32,19 @@ def run_test(testname, logname):
class
Suite
(
object
):
def
__init__
(
self
,
cfgfilename
=
default_config_file
):
self
.
config
=
cfgfilename
self
.
board
=
'SPEC'
self
.
serial
=
''
self
.
path
=
'./tests'
self
.
logpath
=
'./logs'
self
.
pattern
=
'test[0-9][0-9]'
self
.
sequence
=
[]
self
.
log
=
'run_{0}_{1}_{2}_{3}.txt'
self
.
log_pattern
=
'out_
%(serial)
s_
%(timestamp)
s_
%(test)
s.txt'
self
.
config
=
default_config_file
self
.
log_pattern
=
default_log_pattern
self
.
required
=
[
'board'
,
'serial'
,
'test_path'
,
'log_path'
,
'log_name'
,
'sequence'
]
for
fieldname
in
self
.
required
:
self
.
__setattr__
(
fieldname
,
None
)
def
missing
(
self
):
"""report missing fields before suite run"""
missing
=
[
fieldname
for
fieldname
in
self
.
required
if
self
.
__getattribute__
(
fieldname
)
is
None
]
return
missing
def
read_config
(
self
):
try
:
...
...
@@ -52,10 +57,9 @@ class Suite(object):
self
.
board
=
config
.
get
(
'global'
,
'board'
)
self
.
serial
=
config
.
get
(
'global'
,
'serial'
)
self
.
path
=
config
.
get
(
'files'
,
'path'
)
self
.
logpath
=
config
.
get
(
'files'
,
'logs'
)
self
.
pattern
=
config
.
get
(
'files'
,
'pattern'
)
self
.
log
=
config
.
get
(
'files'
,
'log'
)
self
.
path
=
config
.
get
(
'files'
,
'test_path'
)
self
.
logpath
=
config
.
get
(
'files'
,
'log_path'
)
self
.
pattern
=
config
.
get
(
'files'
,
'log_name'
)
self
.
log_pattern
=
config
.
get
(
'files'
,
'log_pattern'
)
def
run
(
self
):
...
...
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