Skip to content

Commit 10e4464

Browse files
committed
Improve error messages when jt test compiler graphs fails
1 parent d65c347 commit 10e4464

File tree

1 file changed

+8
-3
lines changed
  • test/truffle/compiler/graphs

1 file changed

+8
-3
lines changed

test/truffle/compiler/graphs/run.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33
$tests = 0
44
$failures = 0
55

6-
def test(program, extra = '', shape_expected)
6+
def test(program, shape_expected)
77
$tests += 1
8-
output = `bin/jt -q graph --json --describe #{program} #{extra}`
8+
command = "bin/jt -q graph --json --describe #{program}"
9+
output = `#{command}`
10+
unless $?.success?
11+
abort "`#{command}` failed (#{$?}).\nOutput:\n#{output}\n"
12+
end
913
last_line = output.lines.last.strip
1014

1115
begin
1216
decoded = JSON.parse(last_line, symbolize_names: true)
1317
rescue JSON::ParserError => e
14-
abort "#{program}: could not parse JSON (#{e}):\n#{output}"
18+
abort "ERROR: Could not parse JSON from command `#{command}` (#{e}).\n" \
19+
"JSON line:\n#{last_line}\nFull output:\n#{output}\n"
1520
end
1621

1722
shape_got = decoded

0 commit comments

Comments
 (0)