diff --git a/tests/test-355chapters.rb b/tests/test-355chapters.rb old mode 100644 new mode 100755 index 6ab2c3ada..f35ff36e9 --- a/tests/test-355chapters.rb +++ b/tests/test-355chapters.rb @@ -14,7 +14,7 @@ end # Invalid files: invalid.sort.each do |chapters| test chapters do - messages = merge "#{source} --chapters #{chapters}", :exit_code => 2 + messages, exit_code = merge("#{source} --chapters #{chapters}", :exit_code => 2) messages.detect { |line| /The\s+XML\s+chapter\s+file.*contains\s+an\s+error/i.match line } ? :ok : :bad end end diff --git a/tests/test-356tags.rb b/tests/test-356tags.rb old mode 100644 new mode 100755 index 00f313c45..fa6621593 --- a/tests/test-356tags.rb +++ b/tests/test-356tags.rb @@ -14,7 +14,7 @@ end # Invalid files: invalid.sort.each do |tags| test tags do - messages = merge "--tags 0:#{tags} #{source}", :exit_code => 2 + messages, exit_code = merge("--tags 0:#{tags} #{source}", :exit_code => 2) messages.detect { |line| /The\s+XML\s+tag\s+file.*contains\s+an\s+error/i.match line } ? :ok : :bad end end diff --git a/tests/test-378deprecated_iso_639_2_codes.rb b/tests/test-378deprecated_iso_639_2_codes.rb old mode 100644 new mode 100755 index 45f77622f..3cecddf51 --- a/tests/test-378deprecated_iso_639_2_codes.rb +++ b/tests/test-378deprecated_iso_639_2_codes.rb @@ -5,7 +5,7 @@ the_file = "data/mkv/deprecated-languages.mkv" # T_378deprecated_iso_639_2_codes describe "mkvmerge / handling deprecated ISO 639-2 language codes" test "identification" do - identify(the_file).select { |e| /language:/.match(e) }.collect { |e| e.chomp.gsub(/.*language:(\w+).*/, '\1') }.compact.sort.join('+') + identify(the_file)[0].select { |e| /language:/.match(e) }.collect { |e| e.chomp.gsub(/.*language:(\w+).*/, '\1') }.compact.sort.join('+') end test_merge the_file diff --git a/tests/test-390timecode_info_on_resync.rb b/tests/test-390timecode_info_on_resync.rb old mode 100644 new mode 100755 index d2bca77ce..96d8e5fb0 --- a/tests/test-390timecode_info_on_resync.rb +++ b/tests/test-390timecode_info_on_resync.rb @@ -4,6 +4,6 @@ describe 'mkvmerge / output timecodes on resync' test 'data/mkv/resync-after-broken.mkv' do - output = merge('data/mkv/resync-after-broken.mkv', :args => '--ui-language en_US').join('') + output = merge('data/mkv/resync-after-broken.mkv', :args => '--ui-language en_US')[0].join('') [/last.*timecode.*before.*error/, /first.*cluster.*timecode.*resync/].collect { |re| re.match(output) ? 'ok' : 'BAD' }.join('+') end diff --git a/tests/test.d/simple_test.rb b/tests/test.d/simple_test.rb index 754cd7c11..a5e36afe9 100644 --- a/tests/test.d/simple_test.rb +++ b/tests/test.d/simple_test.rb @@ -257,9 +257,15 @@ class SimpleTest 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 + exit_code = 0 + if !system(command) + exit_code = $? >> 8 + self.error "system command failed: #{command} (#{exit_code})" if options[:exit_code] != exit_code + end + + return IO.readlines(temp_file.path), exit_code if temp_file + return exit_code end def error reason