def METHOD_NAME(*, file_names=None, file_ext=None, path):
    """
    Runs tests against a real ROM.
    file_ext is the file extensions checked and path the path prefix.
    The env var SKYTEMPLE_TEST_ROM must contain the path to the ROM otherwise the test is skipped.
    Tests are marked with the pytest mark "romtest".
    """
    def _outer_wrapper(wrapped_function):
        import inspect
        from unittest import SkipTest
        import pytest
        from ndspy.rom import NintendoDSRom
        from parameterized import parameterized
        rom = None
        if (
            "SKYTEMPLE_TEST_ROM" in os.environ
            and os.environ["SKYTEMPLE_TEST_ROM"] != ""
        ):
            rom = NintendoDSRom.fromFile(os.environ["SKYTEMPLE_TEST_ROM"])
        if rom:
            def dataset_name_func(testcase_func, _, param):
                return f"{testcase_func.__name__}/{param.args[0]}"
            if file_ext is not None and file_names is not None:
                raise TypeError(
                    "file_ext and file_names can not be set at the same time."
                )
            if file_ext is not None:
                files = [
                    (x, rom.getFileByName(x))
                    for x in get_files_from_rom_with_extension(rom, file_ext)
                    if x.startswith(path)
                ]
            elif file_names is not None:
                files = [(x, rom.getFileByName(path + x)) for x in file_names]
            else:
                raise TypeError(
                    "Either file_ext or file_names can not be set at the same time."
                )
            if len(files) < 1:
                def no_files(*args, **kwargs):
                    raise SkipTest("No matching files were found in the ROM.")
                return pytest.mark.METHOD_NAME(no_files)
            else:
                spec = inspect.getfullargspec(wrapped_function)
                if "pmd2_data" in spec.args or "pmd2_data" in spec.kwonlyargs:
                    pmd2_data = get_ppmdu_config_for_rom(rom)
                    def pmd2datawrapper(*args, **kwargs):
                        return wrapped_function(*args, **kwargs, pmd2_data=pmd2_data)
                    pmd2datawrapper.__name__ = wrapped_function.__name__
                    parameterized.expand(files, name_func=dataset_name_func)(
                        pytest.mark.METHOD_NAME(pmd2datawrapper)
                    )
                else:
                    parameterized.expand(files, name_func=dataset_name_func)(
                        pytest.mark.METHOD_NAME(wrapped_function)
                    )
                # since expands now adds the tests to our locals, we need to pass them back...
                # this isn't hacky at all wdym??????ßßß
                frame_locals = inspect.currentframe().f_back.f_locals  # type: ignore
                for local_name, local in inspect.currentframe().f_locals.items():  # type: ignore
                    if local_name.startswith("test_"):
                        frame_locals[local_name] = local
        else:
            def no_tests(*args, **kwargs):
                raise SkipTest("No ROM file provided or ROM not found.")
            return pytest.mark.METHOD_NAME(no_tests)
    return _outer_wrapper