[otbnsim] Make test names more meaningful pytest names of parametrized tests are derived from the arguments and then abbreviated. Use a more meaningful name to make tests easier to recognize and test artifacts in the temp folder easier to find. For example, the test runs now report this (the names in the [] changed): ``` hw/ip/otbn/dv/otbnsim/test/simple_test.py::test_count[add.s] PASSED hw/ip/otbn/dv/otbnsim/test/simple_test.py::test_count[addi.s] PASSED hw/ip/otbn/dv/otbnsim/test/simple_test.py::test_count[bnlid.s] PASSED hw/ip/otbn/dv/otbnsim/test/simple_test.py::test_count[li.s] PASSED hw/ip/otbn/dv/otbnsim/test/simple_test.py::test_count[loop-end-loop.s] PASSED hw/ip/otbn/dv/otbnsim/test/simple_test.py::test_count[loop-overflow.s] PASSED hw/ip/otbn/dv/otbnsim/test/simple_test.py::test_count[loop-zero.s] PASSED hw/ip/otbn/dv/otbnsim/test/simple_test.py::test_count[loops.s] PASSED hw/ip/otbn/dv/otbnsim/test/simple_test.py::test_count[overflow.s] PASSED hw/ip/otbn/dv/otbnsim/test/simple_test.py::test_count[underflow.s] PASSED ``` Signed-off-by: Philipp Wagner <phw@lowrisc.org>
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple_test.py b/hw/ip/otbn/dv/otbnsim/test/simple_test.py index e6621b9..6f8f47e 100644 --- a/hw/ip/otbn/dv/otbnsim/test/simple_test.py +++ b/hw/ip/otbn/dv/otbnsim/test/simple_test.py
@@ -159,4 +159,6 @@ def pytest_generate_tests(metafunc: Any) -> None: if metafunc.function is test_count: - metafunc.parametrize("asm_file,expected_file", find_simple_tests()) + tests = find_simple_tests() + test_ids = [os.path.basename(e[0]) for e in tests] + metafunc.parametrize("asm_file,expected_file", tests, ids=test_ids)