-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove ydir and use explicit paths instead
- Loading branch information
Showing
2 changed files
with
240 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,34 @@ | ||
import glob | ||
import os | ||
import pytest | ||
from siliconcompiler import Chip | ||
|
||
from lambdalib import lambdalib | ||
|
||
|
||
def test_pdk_paths(): | ||
def test_paths_valid(): | ||
chip = Chip('<lib>') | ||
chip.use(lambdalib) | ||
assert chip.check_filepaths() | ||
|
||
|
||
@pytest.mark.parametrize('lib', lambdalib._dependencies().keys()) | ||
def test_extra_files(lib): | ||
''' | ||
Ensure all files are included in the lists | ||
''' | ||
dependencies = lambdalib._dependencies()[lib][0] | ||
|
||
fs_base = os.path.dirname(lambdalib.__file__) | ||
rm_base = os.path.dirname(fs_base) | ||
|
||
fs_files = [] | ||
lib_files = [] | ||
for name in [lib, *dependencies]: | ||
lib_files.extend(lambdalib._dependencies()[name][1]()) | ||
|
||
glob_path = f"{fs_base}/{name}/rtl/*.v" | ||
fs_files.extend([f[len(rm_base)+1:] for f in glob.glob(glob_path)]) | ||
|
||
assert not set(fs_files).difference(set(lib_files)) | ||
assert not set(lib_files).difference(set(fs_files)) |