Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CTU CAN FD IP Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
canbus
CTU CAN FD IP Core
Commits
8140fe83
Commit
8140fe83
authored
May 31, 2018
by
Martin Jeřábek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow tests to be run standalone, properly scan test cases from unit tests
parent
dcd5d13d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
test/run.py
test/run.py
+9
-4
test/sanity/tb_sanity.vhd
test/sanity/tb_sanity.vhd
+1
-1
test/unit/vunittb_wrapper.vhd
test/unit/vunittb_wrapper.vhd
+5
-5
No files found.
test/run.py
View file @
8140fe83
...
...
@@ -55,14 +55,16 @@ def create_wrapper(lib):
))
tbs
.
append
(
dedent
(
"""
\
library work;
USE work.CANtestLib.All;
use work.CANtestLib.All;
library vunit_lib;
context vunit_lib.vunit_context;
entity tb_{test} is generic (runner_cfg : string); end entity;
entity tb_{test} is generic (runner_cfg : string
:= runner_cfg_default
); end entity;
architecture tb of tb_{test} is
component vunittb_wrapper is generic (
x
runner_cfg : string); end component;
component vunittb_wrapper is generic (
nested_
runner_cfg : string); end component;
for all:vunittb_wrapper use configuration work.tbconf_{test};
begin
tb:vunittb_wrapper generic map(
x
runner_cfg => runner_cfg);
tb:vunittb_wrapper generic map(
nested_
runner_cfg => runner_cfg);
end architecture;
-- -----------------------------------------------------------------------------
"""
.
format
(
test
=
test
)
...
...
@@ -99,6 +101,9 @@ for pattern in ['../src/**/*.vhd', '*.vhd', 'unit/**/*.vhd', 'sanity/*.vhd', 'li
lib
.
add_source_file
(
str
(
f
))
create_wrapper
(
lib
)
unit_tests
=
lib
.
get_test_benches
(
'*_unit_test'
)
for
ut
in
unit_tests
:
ut
.
scan_tests_from_file
(
"../unit/vunittb_wrapper.vhd"
)
#lib.add_compile_option("ghdl.flags", ["-Wc,-g"])
...
...
test/sanity/tb_sanity.vhd
View file @
8140fe83
...
...
@@ -53,7 +53,7 @@ USE work.CANtestLib.All;
entity
tb_sanity
is
generic
(
runner_cfg
:
string
;
runner_cfg
:
string
:
=
runner_cfg_default
;
log_level
:
log_lvl_type
:
=
info_l
;
error_beh
:
err_beh_type
:
=
quit
;
-- Test behaviour when error occurs: Quit, or Go on
error_tol
:
natural
:
=
0
-- Error tolerance, error counter should not
...
...
test/unit/vunittb_wrapper.vhd
View file @
8140fe83
...
...
@@ -53,7 +53,7 @@ USE work.CANtestLib.All;
entity
vunittb_wrapper
is
generic
(
x
runner_cfg
:
string
;
nested_
runner_cfg
:
string
;
iterations
:
natural
:
=
50
;
log_level
:
log_lvl_type
:
=
info_l
;
error_beh
:
err_beh_type
:
=
quit
;
-- Test behaviour when error occurs: Quit, or Go on
...
...
@@ -79,9 +79,9 @@ begin
);
main
:
process
begin
test_runner_setup
(
runner
,
x
runner_cfg
);
--
while test_suite loop
if
true
or
run
(
"all"
)
then
test_runner_setup
(
runner
,
nested_
runner_cfg
);
while
test_suite
loop
if
run
(
"all"
)
then
t_run
<=
true
;
wait
until
t_status
=
passed
or
t_status
=
failed
;
report
"Done"
;
...
...
@@ -89,7 +89,7 @@ begin
wait
for
100
ns
;
t_run
<=
false
;
end
if
;
--
end loop;
end
loop
;
test_runner_cleanup
(
runner
,
t_errors
>
error_tol
);
end
process
;
end
architecture
;
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