2019-07-08 04:12:15 -06:00
|
|
|
import sys
|
|
|
|
import subprocess
|
|
|
|
from pathlib import Path
|
|
|
|
|
2019-10-13 12:53:38 -06:00
|
|
|
from .utils import *
|
2019-07-08 04:12:15 -06:00
|
|
|
|
|
|
|
|
|
|
|
def example_test(name):
|
|
|
|
path = (Path(__file__).parent / ".." / ".." / "examples" / name).resolve()
|
|
|
|
def test_function(self):
|
2020-06-11 10:29:12 -06:00
|
|
|
subprocess.check_call([sys.executable, str(path), "generate", "-t", "v"],
|
|
|
|
stdout=subprocess.DEVNULL)
|
2019-07-08 04:12:15 -06:00
|
|
|
return test_function
|
|
|
|
|
|
|
|
|
|
|
|
class ExamplesTestCase(FHDLTestCase):
|
|
|
|
test_alu = example_test("basic/alu.py")
|
|
|
|
test_alu_hier = example_test("basic/alu_hier.py")
|
|
|
|
test_arst = example_test("basic/arst.py")
|
|
|
|
test_cdc = example_test("basic/cdc.py")
|
|
|
|
test_ctr = example_test("basic/ctr.py")
|
2019-08-12 07:37:18 -06:00
|
|
|
test_ctr_en = example_test("basic/ctr_en.py")
|
2019-07-08 04:12:15 -06:00
|
|
|
test_fsm = example_test("basic/fsm.py")
|
|
|
|
test_gpio = example_test("basic/gpio.py")
|
|
|
|
test_inst = example_test("basic/inst.py")
|
|
|
|
test_mem = example_test("basic/mem.py")
|
|
|
|
test_pmux = example_test("basic/pmux.py")
|
|
|
|
test_por = example_test("basic/por.py")
|
2020-06-11 10:29:12 -06:00
|
|
|
|
|
|
|
def test_uart(self):
|
|
|
|
path = (Path(__file__).parent / ".." / ".." / "examples" / "basic" / "uart.py").resolve()
|
|
|
|
def test_function(self):
|
|
|
|
subprocess.check_call([sys.executable, str(path), "generate"],
|
|
|
|
stdout=subprocess.DEVNULL)
|