feat: Phase 3+4 - gcov support + enhanced report
This commit is contained in:
@@ -4,11 +4,13 @@ from runners.runner import BuildResult, RunResult
|
||||
|
||||
|
||||
class CobolRunner:
|
||||
def compile(self, src: str, dialect="ibm") -> BuildResult:
|
||||
def compile(self, src: str, dialect="ibm", gcov: bool = False) -> BuildResult:
|
||||
stem = Path(src).stem
|
||||
out = str(Path(src).parent / stem)
|
||||
p = subprocess.run(["cobc", "-x", f"-std={dialect}-strict", "-o", out, src],
|
||||
capture_output=True, text=True, timeout=30)
|
||||
cmd = ["cobc", "-x", f"-std={dialect}-strict", "-o", out, src]
|
||||
if gcov:
|
||||
cmd = ["cobc", "-x", f"-std={dialect}-strict", "-fprofile-arcs", "-ftest-coverage", "-o", out, src]
|
||||
p = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
|
||||
return BuildResult(success=p.returncode == 0, artifact_path=out, log=p.stdout + p.stderr)
|
||||
|
||||
def run(self, binary: str, input_path: str, output_path: str) -> RunResult:
|
||||
|
||||
Reference in New Issue
Block a user