Skip to content

Commit

Permalink
tests: Enable pytest testing
Browse files Browse the repository at this point in the history
Use `pdm run pytest` to run all tests.
  • Loading branch information
jeanthom committed Sep 13, 2024
1 parent 564a68f commit 2cee670
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
10 changes: 5 additions & 5 deletions lambdalib/tests/test_cores_i2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from amaranth import *
from amaranth.lib.io import Pin

from ..cores.i2c.stream import *
from ..cores.i2c.proto import *
from lambdalib.cores.i2c.stream import *
from lambdalib.cores.i2c.proto import *

from amaranth.sim import *
from ..interface.stream_sim import *
from lambdalib.interface.stream_sim import *


class I2C_Pins_Stub:
Expand Down Expand Up @@ -104,6 +104,6 @@ def test_i2c_proto():


if __name__ == "__main__":
# test_i2c_stream_writer()
# test_i2c_stream()
test_i2c_stream_writer()
test_i2c_stream()
test_i2c_proto()
4 changes: 2 additions & 2 deletions lambdalib/tests/test_cores_regs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from amaranth import *
from amaranth.sim import *

from ..interface.stream_sim import *
from ..cores.regs import *
from lambdalib.interface.stream_sim import *
from lambdalib.cores.regs import *


def test_regs():
Expand Down
12 changes: 6 additions & 6 deletions lambdalib/tests/test_cores_spi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
from lambdasoc.soc.base import SoC
from lambdasoc.periph.timer import *

from ..cores.spi.master import *
from ..cores.spi.slave import *
from ..cores.spi.bridge import *
from ..cores.spi.stream import *
from ..cores.spi.common import *
from lambdalib.cores.spi.master import *
from lambdalib.cores.spi.slave import *
from lambdalib.cores.spi.bridge import *
from lambdalib.cores.spi.stream import *
from lambdalib.cores.spi.common import *


from amaranth.sim import *
from ..interface.stream_sim import *
from lambdalib.interface.stream_sim import *


class MasterSlaveBench(Elaboratable):
Expand Down
4 changes: 2 additions & 2 deletions lambdalib/tests/test_interface_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from amaranth import *
from amaranth.sim import *

from ..interface.stream_sim import *
from ..interface.stream_utils import *
from lambdalib.interface.stream_sim import *
from lambdalib.interface.stream_utils import *


def test_splitter():
Expand Down
13 changes: 12 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ authors = [
{name = "Pierre-Olivier Vauboin", email = "[email protected]"},
]
dependencies = [
"luna @ git+https://github.com/greatscottgadgets/luna.git",
"luna-usb @ git+https://github.com/greatscottgadgets/luna.git",
"amaranth @ git+https://github.com/amaranth-lang/amaranth@4d1c4fc20dc44398c09d334b7f34096b0185d43d",
"amaranth-stdio @ git+https://github.com/amaranth-lang/amaranth-stdio@8ebce9bc535f96a0f479a53f1fa000bff71aceb8",
"amaranth-boards @ git+https://github.com/amaranth-lang/amaranth-boards.git",
"amaranth-soc @ git+https://github.com/amaranth-lang/amaranth-soc@d66881d83419c689fc96168150e57d9f467723aa",
]
requires-python = ">=3.9"
readme = "README.md"
Expand All @@ -19,3 +21,12 @@ requires = ["pdm-backend"]
build-backend = "pdm.backend"

[tool.pdm]

[tool.pdm.dev-dependencies]
test = [
"pdm[pytest]",
"pytest-cov",
"lambdasoc @ git+https://github.com/lambdaconcept/lambdasoc",
"minerva @ git+https://github.com/minerva-cpu/minerva",
"setuptools",
]

0 comments on commit 2cee670

Please sign in to comment.