tests: add SimpleTest#test_info method

This commit is contained in:
Moritz Bunkus 2014-12-16 16:51:20 +01:00
parent a8a1e26193
commit 30af0c578a
2 changed files with 16 additions and 11 deletions

13
tests/test-265mkvinfo_clusters_with_unknown_size.rb Normal file → Executable file
View File

@ -1,13 +1,4 @@
#!/usr/bin/ruby -w
class T_265mkvinfo_clusters_with_unknown_size < Test
def description
return "mkvinfo / Clusters with an unknown size"
end
def run
sys "../src/mkvinfo -v -v -z --ui-language en_US data/webm/live-stream.webm > #{tmp}"
return hash_tmp
end
end
describe "mkvinfo / Clusters with an unknown size"
test_info "data/webm/live-stream.webm", :args => "-v -v -z"

View File

@ -133,6 +133,20 @@ class SimpleTest
}
end
def test_info file, *args
options = args.extract_options!
full_command_line = [ options[:args], file ].flatten.join(' ')
options[:name] ||= full_command_line
@blocks[:tests] << {
:name => full_command_line,
:block => lambda {
output = options[:output] || tmp
info full_command_line, :exit_code => options[:exit_code], :output => output
options[:keep_tmp] ? hash_file(output) : hash_tmp
},
}
end
def test_merge_unsupported file, *args
options = args.extract_options!
full_command_line = [ options[:args], file ].flatten.join(' ')