Skip to content

Commit

Permalink
tests: Connect UMI example and tests to pytest
Browse files Browse the repository at this point in the history
Signed-off-by: Edgar E. Iglesias <[email protected]>
  • Loading branch information
edgarigl committed Dec 23, 2023
1 parent 959e45c commit 42aa8ed
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ def pytest_configure(config):
config.addinivalue_line("markers" ,"tg: A traffic generator")
config.addinivalue_line("markers" ,"qdma: Xilinx QDMA")
config.addinivalue_line("markers" ,"hsc: Xilinx HSC")
config.addinivalue_line("markers" ,"umi: Universal Memory Interface")
13 changes: 13 additions & 0 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
'./example-rtl-axi4lite/example-rtl-axi4lite',
'./example-rtl-mixed/example-rtl-mixed']

# Add UMI example if available.
try:
testnames_umi = fnmatch.filter(os.listdir(os.path.dirname(__file__) +
"/example-rtl-umi/obj_dir/"), 'example-rtl-umi')
except Exception:
testnames_umi = []
pass

@pytest.mark.checker
@pytest.mark.tg
@pytest.mark.axi4
Expand All @@ -17,3 +25,8 @@
def test_axi_tg_tests(filename):
path_exe = os.path.normpath(os.path.dirname(__file__) + '/' + filename)
assert(subprocess.call([path_exe]) == 0)

@pytest.mark.parametrize("filename", testnames_umi)
def test_umi_example(filename):
path_exe = os.path.normpath(os.path.dirname(__file__) + '/example-rtl-umi/obj_dir/' + filename)
assert(subprocess.call([path_exe]) == 0)
10 changes: 10 additions & 0 deletions tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
"/traffic-generators/ccix/"), '*-tg-test')
tests_tg_ccix = ['./traffic-generators/ccix/{0}'.format(i) for i in tg_ccix_tests]

tg_umi_tests = fnmatch.filter(os.listdir(os.path.dirname(__file__) +
"/traffic-generators/umi/"), 'test-umi-dw*[0-9]')
tests_tg_umi = ['./traffic-generators/umi/{0}'.format(i) for i in tg_umi_tests]

hwb_axi_testnames = fnmatch.filter(os.listdir(os.path.dirname(__file__) + "/rtl-bridges/axi/"), '*-test-pcie-master')
hwb_axi_testnames += fnmatch.filter(os.listdir(os.path.dirname(__file__) + "/rtl-bridges/axi/"), '*-test-pcie-slave')
hwb_axi_testnames += fnmatch.filter(os.listdir(os.path.dirname(__file__) + "/rtl-bridges/axi/"), 'test-slave-directed')
Expand Down Expand Up @@ -169,6 +173,12 @@ def test_tg_ccix_tests(filename):
path_exe = os.path.normpath(os.path.dirname(__file__) + '/' + filename)
assert(subprocess.call([path_exe]) == 0)

@pytest.mark.umi
@pytest.mark.parametrize("filename", tests_tg_umi)
def test_tg_umi_tests(filename):
path_exe = os.path.normpath(os.path.dirname(__file__) + '/' + filename)
assert(subprocess.call([path_exe]) == 0)

def get_ipxact_tests():
ex_path = os.path.dirname(__file__)
ex_path += '/../packages/ipxact/xilinx.com/examples/'
Expand Down

0 comments on commit 42aa8ed

Please sign in to comment.