From d672c353542de8d4a2c37a181602223a792413ca Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 16 Nov 2018 09:51:30 +0100 Subject: [PATCH] tests: switch to mkvextract's new syntax --- tests/test-360X_chapters_hex_format.rb | 2 +- tests/test-374extract_chapters_with_ebml_void.rb | 2 +- tests/test-426extract_write_bom_only_once.rb | 2 +- tests/test-531simple_chapter_extraction.rb | 2 +- tests/test-551deprecated_cctld_codes.rb | 2 +- tests/test-650chapter_generation_no_names.rb | 2 +- tests/test.d/simple_test.rb | 3 ++- 7 files changed, 8 insertions(+), 7 deletions(-) mode change 100644 => 100755 tests/test-360X_chapters_hex_format.rb mode change 100644 => 100755 tests/test-374extract_chapters_with_ebml_void.rb diff --git a/tests/test-360X_chapters_hex_format.rb b/tests/test-360X_chapters_hex_format.rb old mode 100644 new mode 100755 index 72b6776f4..abc241d2d --- a/tests/test-360X_chapters_hex_format.rb +++ b/tests/test-360X_chapters_hex_format.rb @@ -5,6 +5,6 @@ describe "mkvextract / extract XML chapters with binary elements (hex format)" test_merge "data/subtitles/srt/ven.srt --chapters data/text/chapters-hex-format.xml", :keep_tmp => true test "extraction" do - extract "#{tmp} > #{tmp}-chapters", :mode => :chapters + extract tmp, :mode => :chapters, :args => "#{tmp}-chapters" hash_file "#{tmp}-chapters" end diff --git a/tests/test-374extract_chapters_with_ebml_void.rb b/tests/test-374extract_chapters_with_ebml_void.rb old mode 100644 new mode 100755 index 25b417506..2a58536f9 --- a/tests/test-374extract_chapters_with_ebml_void.rb +++ b/tests/test-374extract_chapters_with_ebml_void.rb @@ -4,6 +4,6 @@ describe "mkvextract / extract chapters with EbmlVoid elements" test 'extraction' do - output = extract("data/mkv/chapters-with-ebmlvoid.mkv", :mode => :chapters).join('') + output = extract("data/mkv/chapters-with-ebmlvoid.mkv", :mode => :chapters, :args => "-").join('') /ebml.?void/i.match(output) ? 'BAD' : 'ok' end diff --git a/tests/test-426extract_write_bom_only_once.rb b/tests/test-426extract_write_bom_only_once.rb index c04580bb4..d9ce35267 100755 --- a/tests/test-426extract_write_bom_only_once.rb +++ b/tests/test-426extract_write_bom_only_once.rb @@ -6,7 +6,7 @@ file = "data/mkv/complex.mkv" describe "mkvextract / write BOMs only once with --redirect-output" test "extraction via shell redirection" do - extract(file, :mode => :chapters). + extract(file, :mode => :chapters, :args => "-"). slice(0..-2). join(''). md5 diff --git a/tests/test-531simple_chapter_extraction.rb b/tests/test-531simple_chapter_extraction.rb index 8b9c6c6d6..8d26769f4 100755 --- a/tests/test-531simple_chapter_extraction.rb +++ b/tests/test-531simple_chapter_extraction.rb @@ -6,7 +6,7 @@ describe "mkvextract / chapters in simple format including language selection" %w{love phantom}.each do |file| [ "", "--simple-language eng", "--simple-language spa" ].each do |language| test "extract from #{file} #{language}" do - extract "data/chapters/#{file}.mkv --simple #{language} > #{tmp}", :mode => :chapters + extract "data/chapters/#{file}.mkv", :args => "--simple #{language} #{tmp}", :mode => :chapters hash_tmp end end diff --git a/tests/test-551deprecated_cctld_codes.rb b/tests/test-551deprecated_cctld_codes.rb index 14c89228c..16e12c44a 100755 --- a/tests/test-551deprecated_cctld_codes.rb +++ b/tests/test-551deprecated_cctld_codes.rb @@ -7,6 +7,6 @@ test_merge "data/subtitles/srt/ven.srt", :args => "--chapters data/chapters/uk-a test_merge "data/mkv/chapters-uk-and-gb.mks" test "fix during extraction" do - extract "data/mkv/chapters-uk-and-gb.mks > #{tmp}", :mode => :chapters + extract "data/mkv/chapters-uk-and-gb.mks", :args => tmp, :mode => :chapters hash_tmp end diff --git a/tests/test-650chapter_generation_no_names.rb b/tests/test-650chapter_generation_no_names.rb index eda2aea38..edbdd3261 100755 --- a/tests/test-650chapter_generation_no_names.rb +++ b/tests/test-650chapter_generation_no_names.rb @@ -5,7 +5,7 @@ describe "mkvmerge / generate chapters without names" test_merge "data/simple/v.mp3", args: "--generate-chapters interval:10s --generate-chapters-name-template ''", :keep_tmp => true test :chapter_names do - extract "#{tmp} > #{tmp}-2", :mode => :chapters + extract tmp, :args => "#{tmp}-2", :mode => :chapters content = IO.readlines("#{tmp}-2").join("") ok = %r{ChapterAtom}.match(content) && !%r{Chapter(Display|String|Language)}.match(content) fail "chapter content is bad" if !ok diff --git a/tests/test.d/simple_test.rb b/tests/test.d/simple_test.rb index 9e2d95c8d..93cbaa94b 100644 --- a/tests/test.d/simple_test.rb +++ b/tests/test.d/simple_test.rb @@ -276,7 +276,8 @@ class SimpleTest fail ArgumentError if args.empty? mode = options[:mode] || :tracks - command = "../src/mkvextract --engage no_variable_data #{mode} #{args.first} " + options.keys.select { |key| key.is_a?(Numeric) }.sort.collect { |key| "#{key}:#{options[key]}" }.join(' ') + command = "../src/mkvextract --engage no_variable_data #{args.first} #{mode} " + options.keys.select { |key| key.is_a?(Numeric) }.sort.collect { |key| "#{key}:#{options[key]}" }.join(' ') + command += options[:args] if options.key?(:args) self.sys command, :exit_code => options[:exit_code], :no_result => options[:no_result] end