Signal: allow to use integral Enum for reset value.
[nmigen.git] / nmigen / test / test_examples.py
1 import sys
2 import subprocess
3 from pathlib import Path
4
5 from .utils import *
6
7
8 def example_test(name):
9 path = (Path(__file__).parent / ".." / ".." / "examples" / name).resolve()
10 def test_function(self):
11 subprocess.check_call([sys.executable, str(path), "generate"], stdout=subprocess.DEVNULL)
12 return test_function
13
14
15 class ExamplesTestCase(FHDLTestCase):
16 test_alu = example_test("basic/alu.py")
17 test_alu_hier = example_test("basic/alu_hier.py")
18 test_arst = example_test("basic/arst.py")
19 test_cdc = example_test("basic/cdc.py")
20 test_ctr = example_test("basic/ctr.py")
21 test_ctr_en = example_test("basic/ctr_en.py")
22 test_fsm = example_test("basic/fsm.py")
23 test_gpio = example_test("basic/gpio.py")
24 test_inst = example_test("basic/inst.py")
25 test_mem = example_test("basic/mem.py")
26 test_pmux = example_test("basic/pmux.py")
27 test_por = example_test("basic/por.py")
28 test_uart = example_test("basic/uart.py")