Skip to content

Commit d027052

Browse files
authored
Merge pull request #163 from bretts/quieter-test-task
Show extended output for TestTask failures only with verbose or trace
2 parents 93e55a4 + b878500 commit d027052

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/rake/testtask.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,16 @@ def define
116116
if !ok && status.respond_to?(:signaled?) && status.signaled?
117117
raise SignalException.new(status.termsig)
118118
elsif !ok
119-
fail "Command failed with status (#{status.exitstatus}): " +
120-
"[ruby #{args}]"
119+
status = "Command failed with status (#{status.exitstatus})"
120+
details = ": [ruby #{args}]"
121+
message =
122+
if Rake.application.options.trace or @verbose then
123+
status + details
124+
else
125+
status
126+
end
127+
128+
fail message
121129
end
122130
end
123131
end

0 commit comments

Comments
 (0)