Skip to content

Commit

Permalink
Update cocotb examples and tests paths
Browse files Browse the repository at this point in the history
cocotb 2.0 will move its source to src/ subdirectory in their
repository.
  • Loading branch information
p12tic authored and themperek committed Jan 3, 2025
1 parent fc382bb commit 248723c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion tests/test_cocotb_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
import cocotb
import pytest

from cocotb_test.compat import cocotb_2x_or_newer
from cocotb_test.simulator import run

example_dir = os.path.join(os.path.dirname(os.path.dirname(cocotb.__file__)), "examples")
if cocotb_2x_or_newer:
cocotb_repo_root = os.path.dirname(os.path.dirname(os.path.dirname(cocotb.__file__)))
else:
cocotb_repo_root = os.path.dirname(os.path.dirname(cocotb.__file__))

example_dir = os.path.join(cocotb_repo_root, "examples")

if os.path.isdir(example_dir) == False:
raise IOError("Cocotb example directory not found. Please clone with git and install with `pip -e`")
Expand Down
8 changes: 7 additions & 1 deletion tests/test_cocotb_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
import pytest
import sys

from cocotb_test.compat import cocotb_2x_or_newer
from cocotb_test.simulator import run

tests_dir = os.path.join(os.path.dirname(os.path.dirname(cocotb.__file__)), "tests")
if cocotb_2x_or_newer:
cocotb_repo_root = os.path.dirname(os.path.dirname(os.path.dirname(cocotb.__file__)))
else:
cocotb_repo_root = os.path.dirname(os.path.dirname(cocotb.__file__))

tests_dir = os.path.join(cocotb_repo_root, "tests")

if os.path.isdir(tests_dir) == False:
raise IOError(
Expand Down

0 comments on commit 248723c

Please sign in to comment.