Skip to content

Commit

Permalink
Fix tb_path absolute path broken by VUnit#402. Fixes VUnit#406
Browse files Browse the repository at this point in the history
  • Loading branch information
kraigher committed Nov 7, 2018
1 parent 3ee8f09 commit 8af4b9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions vunit/test/acceptance/artificial/vhdl/tb_magic_paths.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ begin
end procedure;
begin
test_runner_setup(runner, runner_cfg);
check_has_suffix(tb_path, "acceptance/artificial/vhdl/");
check_has_suffix(vunit_lib.run_pkg.tb_path(runner_cfg), "acceptance/artificial/vhdl/");
check_has_suffix(tb_path, "/vunit/test/acceptance/artificial/vhdl/");
check_has_suffix(vunit_lib.run_pkg.tb_path(runner_cfg), "/vunit/test/acceptance/artificial/vhdl/");
test_runner_cleanup(runner);
wait;
end process;
Expand Down
3 changes: 2 additions & 1 deletion vunit/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ def add_source_file(self, # pylint: disable=too-many-arguments
library.add_source_file("file.vhd")
"""
file_name = abspath(file_name)

if file_type is None:
file_type = file_type_of(file_name)
Expand All @@ -1306,7 +1307,7 @@ def add_source_file(self, # pylint: disable=too-many-arguments
include_dirs = add_verilog_include_dir(include_dirs)

new_file_name = self._parent._preprocess( # pylint: disable=protected-access
self._library_name, abspath(file_name), preprocessors)
self._library_name, file_name, preprocessors)

source_file = self._project.add_source_file(new_file_name,
self._library_name,
Expand Down

0 comments on commit 8af4b9b

Please sign in to comment.