def run_orcc(example, search="Annealing", extra_args="arg total_runs=10;"): # dispatch to Orio's main code = join(abspath(dirname(dirname(__file__))),example) os.system("sed -e 's|@SEARCH@|%s|' -e 's|@EXTRA_ARGS@|%s|' %s.in > %s" % (search,extra_args,code,code)) with pytest.raises(SystemExit) as exc: from orio.main.util.globals import Globals Globals.reset() import orio.main.orio_main cmd = ['orcc','-v','--stop-on-error','--logdir=orio/main/tuner/search/tests', code] print((' '.join(cmd))) orio.main.orio_main.start(cmd, orio.main.orio_main.C_CPP) captured = capsys.readouterr() return exc.value.code
def run_orcc(example): # dispatch to Orio's main code = join(abspath(dirname(dirname(__file__))),example) with pytest.raises(SystemExit) as exc: from orio.main.util.globals import Globals Globals.reset() import orio.main.orio_main cmd = ['orcc','-v','--stop-on-error','--logdir=testsuite/regression/src/tests', code] print(' '.join(cmd)) orio.main.orio_main.start(cmd, orio.main.orio_main.C_CPP) captured = capsys.readouterr() #logging.getLogger().info(captured) return exc.value.code
def run_orcc(example): # dispatch to Orio's main code_dir = join(abspath(dirname(dirname(__file__))), '..', 'examples') code = normpath(join(code_dir, example)) spec = normpath(join(code_dir, 'axpy5.spec')) with pytest.raises(SystemExit) as exc: from orio.main.util.globals import Globals Globals.reset() import orio.main.orio_main cmd = [ 'orcc', '-v', '--stop-on-error', '--logdir=orio/tests', '-s', spec, code ] print((' '.join(cmd))) orio.main.orio_main.start(cmd, orio.main.orio_main.C_CPP) captured = capsys.readouterr() #logging.getLogger().info(captured) return exc.value.code
def __init__(self, line_no='', parent=None, meta={}): '''Create an abstract syntax tree node''' self.line_no = line_no # may be null (i.e. empty string) self.parent = parent self.meta = copy.deepcopy(meta) self.initMeta('uses') self.initMeta('defs') self.id = str(Globals().incrementCounter()) self.temp = None
def __init__(self, line_no="", parent=None, meta={}): """Create an abstract syntax tree node""" self.line_no = line_no # may be null (i.e. empty string) self.parent = parent self.meta = meta self.initMeta("uses") self.initMeta("defs") self.id = str(Globals().incrementCounter()) self.temp = None