Tests: output commands if $DEBUG is set

This commit is contained in:
Moritz Bunkus 2013-02-16 15:28:19 +01:00
parent 3b56ac1f15
commit 8a6533dbcd
2 changed files with 2 additions and 0 deletions

View File

@ -249,6 +249,7 @@ class SimpleTest
command << " >#{temp_file.path} 2>&1 "
end
puts "COMMAND #{command}" if ENV['DEBUG']
self.error "system command failed: #{command} (#{$? >> 8})" if !system(command) && (options[:exit_code] != ($? >> 8))
return IO.readlines(temp_file.path) if temp_file

View File

@ -64,6 +64,7 @@ class Test
@debug_commands << command
command << " >/dev/null 2>/dev/null " unless (/>/.match(command))
puts "COMMAND #{command}" if ENV['DEBUG']
error "system command failed: #{command} (" + ($? >> 8).to_s + ")" if !system(command) && ((arg.size == 0) || ((arg[0] << 8) != $?))
end