Skip to content

Commit 42aa8ed

Browse files
committed
tests: Connect UMI example and tests to pytest
Signed-off-by: Edgar E. Iglesias <edgar@zeroasic.com>
1 parent 959e45c commit 42aa8ed

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ def pytest_configure(config):
4141
config.addinivalue_line("markers" ,"tg: A traffic generator")
4242
config.addinivalue_line("markers" ,"qdma: Xilinx QDMA")
4343
config.addinivalue_line("markers" ,"hsc: Xilinx HSC")
44+
config.addinivalue_line("markers" ,"umi: Universal Memory Interface")

tests/test_examples.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
'./example-rtl-axi4lite/example-rtl-axi4lite',
99
'./example-rtl-mixed/example-rtl-mixed']
1010

11+
# Add UMI example if available.
12+
try:
13+
testnames_umi = fnmatch.filter(os.listdir(os.path.dirname(__file__) +
14+
"/example-rtl-umi/obj_dir/"), 'example-rtl-umi')
15+
except Exception:
16+
testnames_umi = []
17+
pass
18+
1119
@pytest.mark.checker
1220
@pytest.mark.tg
1321
@pytest.mark.axi4
@@ -17,3 +25,8 @@
1725
def test_axi_tg_tests(filename):
1826
path_exe = os.path.normpath(os.path.dirname(__file__) + '/' + filename)
1927
assert(subprocess.call([path_exe]) == 0)
28+
29+
@pytest.mark.parametrize("filename", testnames_umi)
30+
def test_umi_example(filename):
31+
path_exe = os.path.normpath(os.path.dirname(__file__) + '/example-rtl-umi/obj_dir/' + filename)
32+
assert(subprocess.call([path_exe]) == 0)

tests/test_generic.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
"/traffic-generators/ccix/"), '*-tg-test')
6060
tests_tg_ccix = ['./traffic-generators/ccix/{0}'.format(i) for i in tg_ccix_tests]
6161

62+
tg_umi_tests = fnmatch.filter(os.listdir(os.path.dirname(__file__) +
63+
"/traffic-generators/umi/"), 'test-umi-dw*[0-9]')
64+
tests_tg_umi = ['./traffic-generators/umi/{0}'.format(i) for i in tg_umi_tests]
65+
6266
hwb_axi_testnames = fnmatch.filter(os.listdir(os.path.dirname(__file__) + "/rtl-bridges/axi/"), '*-test-pcie-master')
6367
hwb_axi_testnames += fnmatch.filter(os.listdir(os.path.dirname(__file__) + "/rtl-bridges/axi/"), '*-test-pcie-slave')
6468
hwb_axi_testnames += fnmatch.filter(os.listdir(os.path.dirname(__file__) + "/rtl-bridges/axi/"), 'test-slave-directed')
@@ -169,6 +173,12 @@ def test_tg_ccix_tests(filename):
169173
path_exe = os.path.normpath(os.path.dirname(__file__) + '/' + filename)
170174
assert(subprocess.call([path_exe]) == 0)
171175

176+
@pytest.mark.umi
177+
@pytest.mark.parametrize("filename", tests_tg_umi)
178+
def test_tg_umi_tests(filename):
179+
path_exe = os.path.normpath(os.path.dirname(__file__) + '/' + filename)
180+
assert(subprocess.call([path_exe]) == 0)
181+
172182
def get_ipxact_tests():
173183
ex_path = os.path.dirname(__file__)
174184
ex_path += '/../packages/ipxact/xilinx.com/examples/'

0 commit comments

Comments
 (0)