"""pytest configuration and CLI options for store-D unit tests.""" import pytest from streamk5_test_helpers import mock_streamk_writer # noqa: F401 @pytest.fixture(autouse=True) def skip_parametrized_if_cli(request): """Skip all tests except test_storeD_cli when CLI options (--mn) are provided.""" if (request.config.getoption("--mn", default=None) is not None and request.function.__name__ != "test_storeD_cli"): pytest.skip("--mn specified: only test_storeD_cli runs") def pytest_addoption(parser): parser.addoption( "--mn", nargs="+", metavar="M,N", help="List of M,N pairs to test, e.g. --mn 23,17 32,32 16,16", ) parser.addoption( "--mt", nargs="+", metavar="MT0,MT1", help="List of MacroTile pairs to test, e.g. --mt 16,16 32,32", ) parser.addoption( "--wave-config", nargs="+", metavar="WG0,WG1", help="List of MIWaveGroup pairs to test, e.g. --wave-config 1,1 2,2", ) parser.addoption( "--dump-asm", action="store_true", default=False, help="Dump generated assembly and store module text for each test case", ) parser.addoption( "--dump-store-insts", action="store_true", default=False, help="Print only the buffer_store_* instructions emitted by the store-D path, " "one per line with the preceding comment for context", ) parser.addoption( "--asm-output-dir", default=None, metavar="DIR", help="Write the full assembled kernel source (.s file) for each CLI test case " "to DIR/test_