def step_compile_c_syntax_only(environment): cmd = "%(cc)s %(filename)s %(cflags)s -fsyntax-only" % environment.__dict__ timeout=20 if environment.memcheck: cmd = "valgrind --tool=memcheck "+cmd timeout *= _VALGRIND_MEMCHECK_FACTOR return execute(environment, cmd, timeout=timeout)
def step_compile_c(environment): """Compile c source code to executable""" cmd = "%(cc)s %(filename)s %(cflags)s %(ldflags)s -o %(executable)s" % environment.__dict__ timeout=environment.compile_timeout if environment.memcheck: cmd = "valgrind --tool=memcheck "+cmd timeout *= _VALGRIND_MEMCHECK_FACTOR return execute(environment, cmd, timeout=timeout)
def step_compile_c_syntax_only(environment): cmd = "%(cc)s %(filename)s %(cflags)s -fsyntax-only" % environment.__dict__ timeout = 20 if environment.memcheck: cmd = "valgrind --tool=memcheck " + cmd timeout *= _VALGRIND_MEMCHECK_FACTOR result = execute(environment, cmd, timeout=timeout) #if environment.compileroutput and not environment.memcheck: # f = open(environment.outputfile, "w") # f.write(result.stdout) # f.close() return result
def step_compile_c_asm(environment): """Compile c source code to assembler""" cmd = "%(cc)s %(filename)s %(cflags)s -S -o %(asmfile)s" % environment.__dict__ timeout=environment.compile_timeout if environment.memcheck: cmd = "valgrind --tool=memcheck "+cmd timeout *= _VALGRIND_MEMCHECK_FACTOR result = execute(environment, cmd, timeout=timeout) if result.fail(): return result try: result.asm = open(environment.asmfile, "rb").read() except: result.error = "couldn't read assembler output" return result
def step_compile_c(environment): """Compile c source code to executable""" cmd = "%(cc)s %(filename)s %(cflags)s %(ldflags)s -o %(executable)s" % environment.__dict__ timeout = environment.compile_timeout if environment.memcheck: cmd = "valgrind --tool=memcheck " + cmd timeout *= _VALGRIND_MEMCHECK_FACTOR result = execute(environment, cmd, timeout=timeout) if environment.compileroutput and not environment.memcheck: out = open(environment.outputfile, "wb") out.write(result.stdout) out.close() err = open(environment.stderrfile, "wb") err.write(result.stderr) err.close() return result
def step_compile_fluffy(environment): cmd = "%(flc)s %(filename)s %(flflags)s -o %(executable)s" % environment.__dict__ return execute(environment, cmd, timeout=30)
def step_runcommand(environment): """Preprocess c source code (to stdout)""" cmd = environment.cmd % environment.__dict__ return execute(environment, cmd, timeout=20)
def step_run(environment, cmd): return execute(environment, cmd, timeout=environment.compile_timeout, shell=True)
def step_preprocess(environment): """Preprocess c source code (to stdout)""" cmd = "%(cc)s %(filename)s %(cflags)s -E -o-" % environment.__dict__ return execute(environment, cmd, timeout=20)