def METHOD_NAME(self):
    basedir = os.path.dirname(inspect.getsourcefile(type(self)))
    program = os.path.join(basedir, self.program)
    if getattr(self, "built_refin", False):
        refin = binpath(program) + ".in"
    else:
        refin = program + ".in"
    if getattr(self, "built_refout", False):
        refout = binpath(program) + ".refout"
    else:
        refout = program + ".refout"
    intext = ""
    if os.path.exists(refin):
        with open(refin, "rb") as f:
            intext = f.read()
    with open(refout, "rb") as f:
        reftext = f.read()
    proc = subprocess.Popen(
        [binpath(program)], stdin=subprocess.PIPE, stdout=subprocess.PIPE
    )
    outtext, _ = proc.communicate(intext)
    # Get rid of newline problems (Windows vs Unix Style)
    outtext_str = outtext.decode("utf8").replace("\r\n", "\n").replace("\r", "\n")
    reftext_str = reftext.decode("utf8").replace("\r\n", "\n").replace("\r", "\n")
    if outtext_str != reftext_str:
        raise TestRefMismatch(self, outtext_str, reftext_str)
    if proc.wait() != 0:
        raise TestExitNonzero(self)