Exemple #1
0
 def test_compile(self):
   input_fh = tempfile.NamedTemporaryFile(suffix=".c", delete=True)
   output_fh = tempfile.NamedTemporaryFile(suffix=".out", delete=False)
   compiler = CC()
   compiler.set_output_filename(output_fh.name)
   input_fh.write(HELLO_WORLD_PROGRAM)
   # We have to rewind the file handle using seek() in order to read the data
   # back from it!
   input_fh.seek(0)
   ok = True
   try:
     compiler.compile(files=[input_fh.name])
   except Exception, e:
     ok = False
     print e
Exemple #2
0
 def __init__(self, *args, **kwargs):
   CC.__init__(self, *args, **kwargs)