From 56357aa31c1740d3e2ecbadf9afcd4c9bec3168d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 23 Feb 2015 20:37:31 +0100 Subject: [PATCH] tests: run ebml_validator after mkvpropedit if it exists --- tests/test-370propedit_attachments.rb | 2 +- tests/test-420matroska_attachment_no_fileuid.rb | 2 +- tests/test-434mkvpropedit_no_track_uid.rb | 2 +- tests/test.d/simple_test.rb | 10 +++++++--- tests/test.d/test.rb | 10 ++++++++-- 5 files changed, 18 insertions(+), 8 deletions(-) mode change 100644 => 100755 tests/test-370propedit_attachments.rb diff --git a/tests/test-370propedit_attachments.rb b/tests/test-370propedit_attachments.rb old mode 100644 new mode 100755 index 9eb34975d..6f884b292 --- a/tests/test-370propedit_attachments.rb +++ b/tests/test-370propedit_attachments.rb @@ -47,7 +47,7 @@ test "several" do commands.each do |command| sys "cp #{src} #{work}" hashes << hash_file(work) - propedit "#{work} #{command}" + propedit work, command hashes << hash_file(work) end diff --git a/tests/test-420matroska_attachment_no_fileuid.rb b/tests/test-420matroska_attachment_no_fileuid.rb index 1b07afda1..5f78ab5f9 100755 --- a/tests/test-420matroska_attachment_no_fileuid.rb +++ b/tests/test-420matroska_attachment_no_fileuid.rb @@ -14,6 +14,6 @@ end test "propedit" do sys "cp #{file} #{tmp}" - propedit "#{tmp} --replace-attachment '=0:data/text/chap1.txt'" + propedit tmp, "--replace-attachment '=0:data/text/chap1.txt'" hash_tmp end diff --git a/tests/test-434mkvpropedit_no_track_uid.rb b/tests/test-434mkvpropedit_no_track_uid.rb index f688752ef..2c7bd0398 100755 --- a/tests/test-434mkvpropedit_no_track_uid.rb +++ b/tests/test-434mkvpropedit_no_track_uid.rb @@ -7,7 +7,7 @@ test "data/mkv/no-track-uid.mks" do sys "cp data/mkv/no-track-uid.mks #{tmp}" hashes << hash_tmp(false) - propedit "#{tmp} --edit track:s1 --set name=chunky-bacon" + propedit tmp, "--edit track:s1 --set name=chunky-bacon" hashes << hash_tmp(false) hashes.join '-' diff --git a/tests/test.d/simple_test.rb b/tests/test.d/simple_test.rb index dc4b5f556..805fd517d 100644 --- a/tests/test.d/simple_test.rb +++ b/tests/test.d/simple_test.rb @@ -248,12 +248,16 @@ class SimpleTest self.sys command, :exit_code => options[:exit_code] end - def propedit *args + def propedit file_name, *args options = args.extract_options! fail ArgumentError if args.empty? - command = "../src/mkvpropedit --engage no_variable_data #{args.first}" - self.sys command, :exit_code => options[:exit_code] + command = "../src/mkvpropedit --engage no_variable_data #{file_name} #{args.first}" + *result = self.sys command, :exit_code => options[:exit_code] + + self.sys "../src/tools/ebml_validator -M #{file_name}" if FileTest.exists?("../src/tools/ebml_validator") + + return *result end def sys *args diff --git a/tests/test.d/test.rb b/tests/test.d/test.rb index 5a89e1e9f..c3ed4af99 100644 --- a/tests/test.d/test.rb +++ b/tests/test.d/test.rb @@ -116,8 +116,14 @@ class Test retcode = args.detect { |a| !a.is_a? String } || 0 args.reject! { |a| !a.is_a? String } - command = "../src/mkvpropedit --engage no_variable_data " + (args.size == 1 ? tmp : args.shift) + " " + args.shift - sys command, retcode + file_name = args.size == 1 ? tmp : args.shift + + command = "../src/mkvpropedit --engage no_variable_data #{file_name} #{args.shift}" + *result = sys command, retcode + + sys "../src/tools/ebml_validator -M #{file_name}" if FileTest.exists?("../src/tools/ebml_validator") + + return *result end def xtr_tracks_s(*args)