-
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.
Merge pull request #36 from siliconcompiler/generate
helper functions to support building a lambdalib compatible stdlib
- Loading branch information
Showing
3 changed files
with
163 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import pytest | ||
import os | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def test_wrapper(tmp_path): | ||
topdir = os.getcwd() | ||
os.chdir(tmp_path) | ||
# Run the test. | ||
yield | ||
os.chdir(topdir) |
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,25 @@ | ||
import os | ||
import lambdalib | ||
|
||
|
||
def test_check(): | ||
lambdalib.copy('./lambda') | ||
assert lambdalib.check('./lambda') | ||
|
||
|
||
def test_check_missing_file(): | ||
lambdalib.copy('./lambda', exclude=('la_and3',)) | ||
assert not lambdalib.check('./lambda') | ||
|
||
|
||
def test_copy(): | ||
lambdalib.copy('./lambda') | ||
|
||
assert os.path.exists('./lambda/la_and2.v') | ||
|
||
|
||
def test_copy_with_exclude(): | ||
lambdalib.copy('./lambda', exclude=('la_and3',)) | ||
|
||
assert os.path.exists('./lambda/la_and2.v') | ||
assert not os.path.exists('./lambda/la_and3.v') |