示例#1
0
def test_compile(src):
    '''Test the compilation phase.'''

    C.reset_compilers()
    comp = C.get_compiler(src, main=True)
    comp.target = comp.mname
    comp.compile()
    os.remove(comp.target)
示例#2
0
def test_parse(src):
  '''Test the parsing phase.'''

  C.reset_compilers()
  comp = C.get_compiler(src, main=True)
  comp.target = comp.mname + '.yml'
  comp.goodies(C.phases.parsing)

  check_file(comp.target)
  os.remove(comp.target)
示例#3
0
def test_run(src):
    '''Test program execution and results.'''

    C.reset_compilers()
    comp = C.get_compiler(src, main=True)
    comp.target = comp.mname
    comp.compile()

    with open(comp.target + '.out', 'w') as tmp:
        subprocess.call([os.path.abspath(comp.target)], stdout=tmp)

    check_file(comp.target + '.out')
    os.remove(comp.target + '.out')
    os.remove(comp.target)