git @ Cat's Eye Technologies Eightebed / ad39e57
Allow load-and-go operation under Cygwin. catseye 10 years ago
2 changed file(s) with 7 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1515 """
1616
1717 import logging
18 import os
1918 import sys
2019
2120 from optparse import OptionParser
4646
4747
4848 def compile_and_run(filename, options):
49 # a bit of a hack
50 a_out = './a.out'
51 if sys.platform == 'cygwin':
52 a_out = './a.exe'
53
4954 logger.info("Compiling...")
5055 output = Popen([options.compiler, filename], stdout=PIPE).communicate()[0]
5156 if options.verbose:
5459 raise RuntimeError("Compilation failed!")
5560 if options.run:
5661 logger.info("Running...")
57 output = Popen(["./a.out"], stdout=PIPE).communicate()[0]
62 output = Popen([a_out], stdout=PIPE).communicate()[0]
5863 if options.clean:
5964 os.remove(filename)
60 os.remove("./a.out")
65 os.remove(a_out)
6166 return output
6267
6368