-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for specific test configuration. Closes #22.
- Loading branch information
Showing
11 changed files
with
739 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
vunit/test/acceptance/artificial/vhdl/tb_with_generic_config.vhd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
-- This Source Code Form is subject to the terms of the Mozilla Public | ||
-- License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
-- You can obtain one at http://mozilla.org/MPL/2.0/. | ||
-- | ||
-- Copyright (c) 2015, Lars Asplund [email protected] | ||
|
||
use std.textio.all; | ||
|
||
library vunit_lib; | ||
context vunit_lib.vunit_context; | ||
|
||
entity tb_with_generic_config is | ||
generic ( | ||
runner_cfg : runner_cfg_t; | ||
output_path : string; | ||
set_generic : string := "default"; | ||
config_generic : string := "default"); | ||
end entity; | ||
|
||
architecture tb of tb_with_generic_config is | ||
begin | ||
test_runner : process | ||
file fptr : text; | ||
begin | ||
test_runner_setup(runner, runner_cfg); | ||
|
||
while test_suite loop | ||
if run("Test 0") then | ||
assert set_generic = "set-for-entity"; | ||
assert config_generic = "default"; | ||
|
||
elsif run("Test 1") then | ||
assert set_generic = "set-for-entity"; | ||
assert config_generic = "set-from-config"; | ||
|
||
elsif run("Test 2") then | ||
assert set_generic = "set-for-test"; | ||
assert config_generic = "default"; | ||
|
||
elsif run("Test 3") then | ||
assert set_generic = "set-for-test"; | ||
assert config_generic = "set-from-config"; | ||
|
||
elsif run("Test 4") then | ||
assert set_generic = "set-from-config"; | ||
assert config_generic = "set-from-config"; | ||
file_open(fptr, output_path & "post_check.txt", write_mode); | ||
write(fptr, string'("Test 4 was here")); | ||
file_close(fptr); | ||
end if; | ||
end loop; | ||
|
||
test_runner_cleanup(runner); | ||
wait; | ||
end process; | ||
test_runner_watchdog(runner, 50 ns); | ||
end architecture; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.