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.
Added possibility to provide a list of files to add_source_files. Closes
- Loading branch information
Showing
2 changed files
with
64 additions
and
6 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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
# You can obtain one at http://mozilla.org/MPL/2.0/. | ||
# | ||
# Copyright (c) 2014-2016, Lars Asplund [email protected] | ||
# pylint: disable=too-many-public-methods | ||
|
||
""" | ||
Acceptance test of the VUnit public interface class | ||
|
@@ -167,6 +168,47 @@ def test_no_exception_on_adding_zero_files_when_allowed(self): | |
lib = ui.library("lib") | ||
lib.add_source_files(join(dirname(__file__), 'missing.vhd'), allow_empty=True) | ||
|
||
def test_add_source_files(self): | ||
files = ["file1.vhd", | ||
"file2.vhd", | ||
"file3.vhd", | ||
"file_foo.vhd"] | ||
|
||
for file_name in files: | ||
self.create_file(file_name) | ||
|
||
ui = self._create_ui() | ||
lib = ui.library("lib") | ||
lib.add_source_files("file*.vhd") | ||
lib.add_source_files("file_foo.vhd") | ||
for file_name in files: | ||
lib.get_source_file(file_name) | ||
|
||
ui = self._create_ui() | ||
lib = ui.library("lib") | ||
lib.add_source_files(["file*.vhd", "file_foo.vhd"]) | ||
for file_name in files: | ||
lib.get_source_file(file_name) | ||
|
||
ui = self._create_ui() | ||
lib = ui.library("lib") | ||
lib.add_source_files(("file*.vhd", "file_foo.vhd")) | ||
for file_name in files: | ||
lib.get_source_file(file_name) | ||
|
||
ui = self._create_ui() | ||
lib = ui.library("lib") | ||
lib.add_source_files(iter(["file*.vhd", "file_foo.vhd"])) | ||
for file_name in files: | ||
lib.get_source_file(file_name) | ||
|
||
def test_add_source_files_errors(self): | ||
ui = self._create_ui() | ||
lib = ui.library("lib") | ||
self.create_file("file.vhd") | ||
self.assertRaisesRegexp(ValueError, r"missing\.vhd", lib.add_source_files, ["missing.vhd", "file.vhd"]) | ||
self.assertRaisesRegexp(ValueError, r"missing\.vhd", lib.add_source_files, "missing.vhd") | ||
|
||
def test_get_source_files(self): | ||
ui = self._create_ui() | ||
lib1 = ui.add_library("lib1") | ||
|
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