def run(self, code, capfd, expected_exitcode=0, cgi=False, args=[]): tmpdir = py.path.local.make_numbered_dir('pyhp') phpfile = tmpdir.join(self.tmpname + '.php') phpfile.write(code) r = main([None, str(phpfile)]) out, err = capfd.readouterr() assert r == expected_exitcode assert not err return out
import sys from rpython.jit.codewriter.policy import JitPolicy from pyhp.main import main def target(driver, args): driver.exe_name = 'pyhp-c' return main, None def jitpolicy(driver): return JitPolicy() if __name__ == '__main__': main(sys.argv)
def main(self, argv): return main(argv)