MCPcopy Index your code
hub / github.com/nodejs/node / FileCheckOutProc

Class FileCheckOutProc

deps/v8/tools/testrunner/outproc/filecheck.py:11–37  ·  view source on GitHub ↗

Processor for FileCheck-based expectations.

Source from the content-addressed store, hash-verified

9
10
11class FileCheckOutProc(base.OutProc):
12 """Processor for FileCheck-based expectations."""
13
14 def __init__(self, expected_outcomes, js_file, expect_d8_fails):
15 super(FileCheckOutProc, self).__init__(expected_outcomes)
16 self._js_file = js_file
17 self.expect_d8_fails = expect_d8_fails
18
19 def _is_failure_output(self, output):
20 if bool(output.exit_code) != self.expect_d8_fails:
21 return True
22
23 cmd = ["vpython3", "-m", "filecheck", str(self._js_file)]
24 # Note that we encode the input again because on Windows providing
25 # > input=output.stdout, encoding="utf-8", text=True
26 # creates some issues with the filecheck CHECK-NEXT directive (maybe
27 # something goes wrong in terms of new lines)...
28 res = subprocess.run(
29 cmd,
30 input=output.stdout.encode("utf-8") + output.stderr.encode("utf-8"),
31 capture_output=True,
32 shell=platform.system() == 'Windows')
33 if res.returncode != 0 and "FileCheck failed" not in output.stderr:
34 # FileCheck failed, add error to stderr (even though technically not
35 # correct) to report it back in the various UIs of testrunners.
36 output.stderr += "\nFileCheck failed:\n" + res.stderr.decode()
37 return res.returncode != 0

Callers 1

output_procMethod · 0.90

Calls

no outgoing calls

Tested by 1

output_procMethod · 0.72