"""
# pass
- def run(self, execcmd, filename, binary, num_id, timeout):
+ def run(self, execcmd, filename, binary, num_id, timeout, batchinfo):
"""Compile that test code and anaylse it with the Tool if needed (a cache system should be used)"""
# pass
output = f"Compiling {binary}.c (batchinfo:{batchinfo})\n\n"
output += f"$ {buildcmd}\n"
- compil = subprocess.run(buildcmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ compil = subprocess.run(buildcmd, shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if compil.stdout is not None:
output += str(compil.stdout, errors='replace')
if compil.returncode != 0:
pid = process.pid
pgid = os.getpgid(pid) # We need that to forcefully kill subprocesses when leaving
- outcome = None
while True:
if poll_obj.poll(5): # Something to read? Do check the timeout status every 5 sec if not
line = process.stdout.readline()
if read_line_lambda != None:
read_line_lambda(line, process)
if time.time() - start_time > timeout:
- outcome = 'timeout'
with open(f'{cachefile}.timeout', 'w') as outfile:
outfile.write(f'{time.time() - start_time} seconds')
break