forked from VUnit/vunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
2,676 additions
and
306 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,2 @@ | ||
|
||
examples/vhdl/run/vunit_out/ | ||
|
||
examples/vhdl/check/vunit_out/ | ||
|
||
examples/vhdl/uart/vunit_out/ | ||
|
||
examples/vhdl/user_guide/vunit_out/ | ||
|
||
vunit/vhdl/check/vunit_out/ | ||
**/vunit_out | ||
*.pyc |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# 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-2016, Lars Asplund [email protected] | ||
|
||
""" | ||
Test builtins.py | ||
""" | ||
|
||
import unittest | ||
from vunit.test.mock_2or3 import mock | ||
from vunit.builtins import BuiltinsAdder | ||
|
||
|
||
class TestBuiltinsAdder(unittest.TestCase): | ||
""" | ||
Test BuiltinsAdder class | ||
""" | ||
|
||
@staticmethod | ||
def test_add_type(): | ||
adder = BuiltinsAdder() | ||
function = mock.Mock() | ||
adder.add_type("foo", function) | ||
adder.add("foo", dict(argument=1)) | ||
function.assert_called_once_with(argument=1) | ||
|
||
def test_adds_dependencies(self): | ||
adder = BuiltinsAdder() | ||
function1 = mock.Mock() | ||
function2 = mock.Mock() | ||
function3 = mock.Mock() | ||
function4 = mock.Mock() | ||
adder.add_type("foo1", function1) | ||
adder.add_type("foo2", function2, ["foo1"]) | ||
adder.add_type("foo3", function3, ["foo2"]) | ||
adder.add_type("foo4", function4) | ||
adder.add("foo3", dict(argument=1)) | ||
adder.add("foo2") | ||
function1.assert_called_once_with() | ||
function2.assert_called_once_with() | ||
function3.assert_called_once_with(argument=1) | ||
self.assertFalse(function4.called) | ||
|
||
def test_runtime_error_on_add_with_different_args(self): | ||
adder = BuiltinsAdder() | ||
function = mock.Mock() | ||
adder.add_type("foo", function) | ||
adder.add("foo", dict(argument=1)) | ||
try: | ||
adder.add("foo", dict(argument=2)) | ||
except RuntimeError as exc: | ||
self.assertEqual(str(exc), | ||
"Optional builtin %r added with arguments %r has already been added with arguments %r" | ||
% ("foo", dict(argument=2), dict(argument=1))) | ||
else: | ||
self.fail("RuntimeError not raised") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,14 @@ | |
# | ||
# Copyright (c) 2014-2015, Lars Asplund [email protected] | ||
|
||
from os.path import join, dirname | ||
from os.path import join, dirname, basename | ||
from vunit import VUnit | ||
from glob import glob | ||
|
||
root = dirname(__file__) | ||
|
||
ui = VUnit.from_argv() | ||
lib = ui.add_library("lib") | ||
ui.add_array_util("lib") | ||
ui.add_array_util() | ||
lib = ui.library("vunit_lib") | ||
lib.add_source_files(join(root, "test", "*.vhd")) | ||
ui.main() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,16 @@ | |
-- Copyright (c) 2016, Lars Asplund [email protected] | ||
|
||
use std.textio.all; | ||
use work.stop_pkg; | ||
|
||
package vunit_core_pkg is | ||
package core_pkg is | ||
procedure setup(file_name : string); | ||
procedure test_start(test_name : string); | ||
procedure test_suite_done; | ||
procedure stop(status : natural); | ||
end package; | ||
|
||
package body vunit_core_pkg is | ||
package body core_pkg is | ||
file test_results : text; | ||
|
||
procedure setup(file_name : string) is | ||
|
@@ -36,4 +38,9 @@ package body vunit_core_pkg is | |
file_close(test_results); | ||
end procedure; | ||
|
||
procedure stop(status : natural) is | ||
begin | ||
stop_pkg.stop(status); | ||
end; | ||
|
||
end package body; |
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 |
---|---|---|
|
@@ -4,9 +4,12 @@ | |
-- | ||
-- Copyright (c) 2015-2016, Lars Asplund [email protected] | ||
|
||
package body vunit_stop_pkg is | ||
procedure vunit_stop(status : integer) is | ||
package body stop_pkg is | ||
procedure stop(status : integer) is | ||
begin | ||
if status /= 0 then | ||
report "Stopping simulation with status " & integer'image(status) severity failure; | ||
end if; | ||
std.env.stop(status); | ||
end procedure; | ||
end package body; |
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 |
---|---|---|
|
@@ -4,9 +4,9 @@ | |
-- | ||
-- Copyright (c) 2015-2016, Lars Asplund [email protected] | ||
|
||
package body vunit_stop_pkg is | ||
procedure vunit_stop(status : integer) is | ||
package body stop_pkg is | ||
procedure stop(status : integer) is | ||
begin | ||
assert false severity failure; | ||
report "Stopping simulation with status " & integer'image(status) severity failure; | ||
end procedure; | ||
end package body; |
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 |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
-- | ||
-- Copyright (c) 2015-2016, Lars Asplund [email protected] | ||
|
||
package vunit_stop_pkg is | ||
procedure vunit_stop(status : integer); | ||
package stop_pkg is | ||
procedure stop(status : integer); | ||
end package; |
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,20 @@ | ||
# 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) 2014-2015, Lars Asplund [email protected] | ||
|
||
from os.path import join, dirname, basename | ||
from vunit import VUnit | ||
from glob import glob | ||
|
||
root = dirname(__file__) | ||
|
||
ui = VUnit.from_argv() | ||
lib = ui.library("vunit_lib") | ||
for file_name in glob(join(root, "test", "*")): | ||
if basename(file_name).endswith("2008.vhd") and ui.vhdl_standard != "2008": | ||
continue | ||
lib.add_source_file(file_name) | ||
|
||
ui.main() |
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,15 @@ | ||
-- 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) 2017, Lars Asplund [email protected] | ||
|
||
context data_types_context is | ||
library vunit_lib; | ||
use vunit_lib.integer_vector_ptr_pkg.all; | ||
use vunit_lib.integer_vector_ptr_pool_pkg.all; | ||
use vunit_lib.integer_array_pkg.all; | ||
use vunit_lib.string_ptr_pkg.all; | ||
use vunit_lib.queue_pkg.all; | ||
use vunit_lib.queue_pool_pkg.all; | ||
end context; |
Oops, something went wrong.