Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
FMC ADC 100M 14b 4cha - Testing
Commits
1215dae1
Commit
1215dae1
authored
Jun 17, 2011
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tps: handle correctly default --yes option
parent
185920c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
tps.py
tps.py
+13
-1
tpsexcept.py
tpsexcept.py
+0
-7
No files found.
tps.py
View file @
1215dae1
#! /user/dcobas/2.7.1/bin/python
#! /usr/bin/env python
# coding: utf8
...
...
@@ -27,6 +28,15 @@ default_log_name = 'tps_run_{runid}_{timestamp}_{board}_{serial}.txt'
default_test_pattern
=
r'test[0-9][0-9]'
default_test_syntax
=
r'(test)?(\d\d)'
original_raw_input
=
raw_input
def
tps_raw_input
(
msg
,
default
=
'y'
):
try
:
ret
=
original_raw_input
(
msg
)
except
EOFError
:
return
default
return
ret
def
run_test
(
testname
,
logname
,
yes
=
False
):
"""run test testname with output redirected to logname
...
...
@@ -38,13 +48,15 @@ def run_test(testname, logname, yes=False):
if
yes
:
tmpin
=
sys
.
stdin
sys
.
stdin
=
open
(
'/dev/null'
)
__builtins__
.
raw_input
=
tps_raw_input
mod
=
__import__
(
testname
,
globals
(),
locals
(),
[])
mod
.
main
(
default_directory
=
'./test/spec/python'
)
finally
:
sys
.
stdout
.
close
()
sys
.
stdout
=
tmpout
if
yes
:
sys
.
stdin
=
tmpin
sys
.
stdin
=
tmpin
raw_input
=
original_raw_input
class
Suite
(
object
):
def
__init__
(
self
,
cfgfilename
=
default_config_file
):
...
...
tpsexcept.py
View file @
1215dae1
...
...
@@ -31,12 +31,5 @@ class TpsBadTestNo(TpsInvalid):
"""reserved: a bad test number was given"""
pass
def
raw_input
(
msg
,
default
=
'y'
):
try
:
ret
=
__builtins__
.
raw_input
(
msg
)
except
EOFError
:
return
default
return
ret
if
__name__
==
'__main__'
:
pass
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