Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
Hdlmake
Commits
0cbb9727
Commit
0cbb9727
authored
Jun 07, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for configparser.
parent
0d2c4ef8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
0 deletions
+62
-0
Manifest.py
testsuite/050err_manifest_type/Manifest.py
+7
-0
Manifest.py
testsuite/051err_manifest_key/Manifest.py
+8
-0
test_all.py
testsuite/test_all.py
+47
-0
No files found.
testsuite/050err_manifest_type/Manifest.py
0 → 100644
View file @
0cbb9727
action
=
[
"simulation"
]
sim_tool
=
"modelsim"
top_module
=
"gate"
files
=
[
"../files/gate.vhdl"
]
testsuite/051err_manifest_key/Manifest.py
0 → 100644
View file @
0cbb9727
action
=
"simulation"
sim_tool
=
"modelsim"
top_module
=
"gate"
files
=
[
"../files/gate.vhdl"
]
modules
=
{
'bad'
:
50
}
testsuite/test_all.py
View file @
0cbb9727
...
...
@@ -2,6 +2,7 @@
# Just run 'pytest' in this directory.
import
hdlmake.__main__
from
hdlmake.manifest_parser.configparser
import
ConfigParser
import
os
import
os.path
import
pytest
...
...
@@ -254,6 +255,52 @@ def test_no_manifest():
with
pytest
.
raises
(
SystemExit
)
as
_
:
run
([],
path
=
"049err_no_manifest"
)
def
test_configparser_bad_descr
():
# More like a unittest
with
pytest
.
raises
(
ValueError
)
as
_
:
_
=
ConfigParser
(
description
=
1
)
def
test_configparser_dup_option
():
p
=
ConfigParser
()
p
.
add_option
(
"a"
,
type
=
{})
with
pytest
.
raises
(
ValueError
)
as
_
:
p
.
add_option
(
"a"
,
type
=
0
)
def
test_configparser_bad_option
():
p
=
ConfigParser
()
with
pytest
.
raises
(
ValueError
)
as
_
:
p
.
add_option
(
"a"
,
type
=
0
,
unknown
=
True
)
def
test_configparser_key
():
p
=
ConfigParser
()
p
.
add_option
(
"a"
,
type
=
{})
p
.
add_allowed_key
(
"a"
,
key
=
"k"
)
with
pytest
.
raises
(
ValueError
)
as
_
:
p
.
add_allowed_key
(
"a"
,
key
=
1
)
def
test_configparser_bad_type
():
# More like a unittest
p
=
ConfigParser
()
with
pytest
.
raises
(
RuntimeError
)
as
_
:
p
.
add_type
(
"a"
,
type_new
=
[])
def
test_configparser_unexpected_key
():
# More like a unittest
p
=
ConfigParser
()
with
pytest
.
raises
(
RuntimeError
)
as
_
:
p
.
add_allowed_key
(
"a"
,
key
=
"k1"
)
p
.
add_option
(
"a"
,
type
=
[])
with
pytest
.
raises
(
RuntimeError
)
as
_
:
p
.
add_allowed_key
(
"a"
,
key
=
"k"
)
def
test_err_manifest_type
():
with
pytest
.
raises
(
SystemExit
)
as
_
:
run
([],
path
=
"050err_manifest_type"
)
def
test_err_manifest_key
():
with
pytest
.
raises
(
SystemExit
)
as
_
:
run
([],
path
=
"051err_manifest_key"
)
@
pytest
.
mark
.
xfail
def
test_xfail
():
"""This is a self-consistency test: the test is known to fail"""
...
...
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