Passes test-igcc

pull/1/head
Christina 4 months ago
parent 6f16a0fa7c
commit bb911bd2bb
Signed by: cafkafk
GPG Key ID: 8ED4DEF7375A30C8
  1. 24
      libigcc/run.py
  2. 840
      test-igcc
  3. 2
      test-igcc-slow

@ -114,21 +114,22 @@ def run_compile(subs_compiler_command, runner):
compile_process = subprocess.Popen(
subs_compiler_command, stdin=subprocess.PIPE, stderr=subprocess.PIPE
)
print(libigcc.source_code.get_full_source(runner))
stdoutdata, stderrdata = compile_process.communicate(
input=(libigcc.source_code.get_full_source(runner).encode())
input=(libigcc.source_code.get_full_source(runner).encode("utf-8", "strict"))
)
if compile_process.returncode == 0:
return None
elif stdoutdata is not None:
if stderrdata is not None:
return stdoutdata.decode() + stderrdata.decode()
return stdoutdata.decode("utf-8", "strict") + stderrdata.decode(
"utf-8", "strict"
)
else:
return stdoutdata.decode()
return stdoutdata.decode("utf-8", "strict")
else:
if stderrdata is not None:
return stderrdata.decode()
return stderrdata.decode("utf-8", "strict")
else:
return "Unknown compile error - compiler did not write any output."
@ -223,10 +224,10 @@ class Runner:
if len(stdoutdata) > self.output_chars_printed:
new_output = stdoutdata[self.output_chars_printed :]
new_output = new_output.decode("utf-8", "strict")
len_new_output = len(new_output)
print(
new_output,
)
new_output = new_output[: len_new_output - 1]
print(new_output)
self.output_chars_printed = (
self.output_chars_printed + len_new_output
)
@ -234,15 +235,14 @@ class Runner:
if len(stderrdata) > self.error_chars_printed:
new_error = stderrdata[self.error_chars_printed :]
new_error = new_error.decode("utf-8", "strict")
len_new_error = len(new_error)
print(
new_error,
)
new_error = new_error[: len_new_error - 1]
print(new_error)
self.error_chars_printed = (
self.error_chars_printed + len_new_error
)
self.user_input[-1].error_chars = len_new_error
print()
def redo(self):

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
function test_lib_dir()
{

Loading…
Cancel
Save