Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lvcnrpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
waveforms
lvcnrpy
Commits
36b90634
There was a problem fetching the pipeline summary.
Commit
36b90634
authored
8 years ago
by
Sebastian Khan
Browse files
Options
Downloads
Patches
Plain Diff
Update lvcnrcheck with pass/fail information
parent
67cd989c
No related branches found
No related tags found
1 merge request
!5
Update lvcnrcheck with pass/fail information
Pipeline
#
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/lvcnrcheck
+20
-7
20 additions, 7 deletions
bin/lvcnrcheck
with
20 additions
and
7 deletions
bin/lvcnrcheck
+
20
−
7
View file @
36b90634
...
...
@@ -51,6 +51,8 @@ else:
def
checkField
(
sim
,
field
):
# Check validity of field against specification class `field`
valid
=
field
.
valid
(
sim
)
msg
=
valid
.
msg
if
valid
.
msg
is
not
None
else
''
...
...
@@ -59,7 +61,7 @@ def checkField(sim, field):
if
isinstance
(
valid
,
err
.
Missing
):
print
FIELD_INVALID
.
format
(
valid
.
name
,
field
.
name
,
'
undefined
'
,
msg
).
strip
(
''
)
return
return
1
# Condition on being an attribute
isAttribute
=
not
isinstance
(
...
...
@@ -69,11 +71,16 @@ def checkField(sim, field):
value
=
sim
.
att
(
field
.
name
)
if
isAttribute
else
type
(
sim
[
field
.
name
])
if
isinstance
(
valid
,
err
.
Valid
):
print
FIELD_VALID
.
format
(
valid
.
name
,
field
.
name
,
value
,
msg
).
strip
()
return
0
else
:
print
FIELD_INVALID
.
format
(
valid
.
name
,
field
.
name
,
value
,
msg
).
strip
()
return
1
if
__name__
==
'
__main__
'
:
# Initialise checkInt. checkInt = 0 for pass and >0 for fail.
checkInt
=
0
sim
=
Sim
(
args
.
file
)
# Format 1
...
...
@@ -83,16 +90,16 @@ if __name__ == '__main__':
print
(
"
## {0:s}
\n
"
.
format
(
groupKey
))
for
fieldKey
,
field
in
group
.
items
():
checkField
(
sim
,
field
())
checkInt
+=
checkField
(
sim
,
field
())
print
(
''
)
if
args
.
format
>
1
:
# Format 2
print
(
'
# Format 2
\n
'
)
for
fieldKey
,
field
in
format2
.
items
():
checkField
(
sim
,
field
())
checkInt
+=
checkField
(
sim
,
field
())
print
(
''
)
...
...
@@ -101,7 +108,7 @@ if __name__ == '__main__':
print
(
'
# Format 3
\n
'
)
for
fieldKey
,
field
in
format3
.
items
():
checkField
(
sim
,
field
())
checkInt
+=
checkField
(
sim
,
field
())
print
(
''
)
...
...
@@ -110,7 +117,7 @@ if __name__ == '__main__':
if
len
(
phaseModes
)
>
0
:
print
(
'
# Phase Modes
\n
'
)
for
phaseMode
in
phaseModes
:
checkField
(
sim
,
phaseMode
)
checkInt
+=
checkField
(
sim
,
phaseMode
)
print
(
''
)
...
...
@@ -119,4 +126,10 @@ if __name__ == '__main__':
if
len
(
ampModes
)
>
0
:
print
(
'
# Amplitude Modes
\n
'
)
for
ampMode
in
ampModes
:
checkField
(
sim
,
ampMode
)
checkInt
+=
checkField
(
sim
,
ampMode
)
# report back if the simulation has passed or failed the check
if
checkInt
==
0
:
print
(
'
pass
'
)
else
:
print
(
'
fail
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment