Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha
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
1
Merge Requests
1
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 TDC 1ns 5cha
Commits
9b7f82ad
Commit
9b7f82ad
authored
Oct 12, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tst: customize dump size on error
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
1f5b7104
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
conftest.py
pytest/conftest.py
+3
-0
test_fmctdc_acquisition.py
pytest/test-01-functionalities/test_fmctdc_acquisition.py
+2
-2
No files found.
pytest/conftest.py
View file @
9b7f82ad
...
...
@@ -64,6 +64,8 @@ def pytest_addoption(parser):
parser
.
addoption
(
"--fd-id"
,
type
=
lambda
x
:
int
(
x
,
16
),
required
=
True
,
help
=
"Fmc Fine-Delay Linux Identifier"
)
parser
.
addoption
(
"--dump-range"
,
type
=
int
,
default
=
10
,
help
=
"Timestamps to show before and after an error"
)
parser
.
addoption
(
"--channel"
,
type
=
int
,
default
=
[],
action
=
"append"
,
choices
=
range
(
FmcTdc
.
CHANNEL_NUMBER
),
help
=
"Channel(s) to be used for acquisition tests. Default all channels"
)
...
...
@@ -80,6 +82,7 @@ def pytest_configure(config):
pytest
.
channels
=
range
(
FmcTdc
.
CHANNEL_NUMBER
)
pytest
.
usr_acq
=
(
config
.
getoption
(
"--usr-acq-period-ns"
),
config
.
getoption
(
"--usr-acq-count"
))
pytest
.
dump_range
=
config
.
getoption
(
"--dump-range"
)
pytest
.
transfer_mode
=
None
with
open
(
"/sys/bus/zio/devices/tdc-1n5c-{:04x}/transfer-mode"
.
format
(
pytest
.
tdc_id
))
as
f_mode
:
...
...
pytest/test-01-functionalities/test_fmctdc_acquisition.py
View file @
9b7f82ad
...
...
@@ -99,7 +99,7 @@ class TestFmctdcAcquisition(object):
len
(
ts
),
str
(
prev
),
str
(
ts
[
i
]),
"
\n
"
.
join
([
str
(
x
)
for
x
in
ts
[
max
(
0
,
i
-
10
):
min
(
i
+
10
,
len
(
ts
)
-
1
)]]))
"
\n
"
.
join
([
str
(
x
)
for
x
in
ts
[
max
(
0
,
i
-
pytest
.
dump_range
):
min
(
i
+
pytest
.
dump_range
,
len
(
ts
)
-
1
)]]))
prev
=
ts
[
i
]
@
pytest
.
mark
.
skipif
(
0
in
pytest
.
usr_acq
,
...
...
@@ -149,7 +149,7 @@ class TestFmctdcAcquisition(object):
len
(
ts
),
str
(
prev
),
str
(
ts
[
i
]),
"
\n
"
.
join
([
str
(
x
)
for
x
in
ts
[
max
(
0
,
i
-
10
):
min
(
i
+
10
,
len
(
ts
)
-
1
)]]))
"
\n
"
.
join
([
str
(
x
)
for
x
in
ts
[
max
(
0
,
i
-
pytest
.
dump_range
):
min
(
i
+
pytest
.
dump_range
,
len
(
ts
)
-
1
)]]))
prev
=
ts
[
i
]
pending
-=
len
(
ts
)
poll
.
unregister
(
fmctdc_chan
.
fileno
)
...
...
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