From 9c61fce55394fcb3c1898f127b129e4817670ac1 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 19 Aug 2004 19:37:07 +0000 Subject: [PATCH] Merged 1996 --- tests/new_test | 24 ++++++++++++++++++++++++ tests/results.txt | 10 +++++++++- tests/run.rb | 23 ++++++++++++++++++++--- tests/test-008avi_divx3_mp3.rb | 13 +++++++++++++ tests/test-009realvideo_3.rb | 13 +++++++++++++ tests/test-010realvideo_4.rb | 13 +++++++++++++ tests/test-011srt.rb | 13 +++++++++++++ tests/test-012ssa.rb | 13 +++++++++++++ tests/test-013vobsubs.rb | 14 ++++++++++++++ tests/test-014splitting_by_size.rb | 25 +++++++++++++++++++++++++ tests/test-015splitting_by_time.rb | 25 +++++++++++++++++++++++++ 11 files changed, 182 insertions(+), 4 deletions(-) create mode 100755 tests/new_test create mode 100755 tests/test-008avi_divx3_mp3.rb create mode 100755 tests/test-009realvideo_3.rb create mode 100755 tests/test-010realvideo_4.rb create mode 100755 tests/test-011srt.rb create mode 100755 tests/test-012ssa.rb create mode 100755 tests/test-013vobsubs.rb create mode 100755 tests/test-014splitting_by_size.rb create mode 100644 tests/test-015splitting_by_time.rb diff --git a/tests/new_test b/tests/new_test new file mode 100755 index 000000000..f6d7151e7 --- /dev/null +++ b/tests/new_test @@ -0,0 +1,24 @@ +#!/bin/sh + +if [ "$1" == "" ]; then + echo 'Name?' + exit 1 +fi + +N=`echo $1 | sed -e 's/\.rb//'` +cat > test-$N.rb < 0 ? (num_failed * 100 / num_tests).to_s : "0") + "%)") + (num_tests > 0 ? (num_failed * 100 / num_tests).to_s : "0") + "%). " + + "Tests took #{duration}s.") exit(num_failed > 0 ? 1 : 0) end diff --git a/tests/test-008avi_divx3_mp3.rb b/tests/test-008avi_divx3_mp3.rb new file mode 100755 index 000000000..a5097cc02 --- /dev/null +++ b/tests/test-008avi_divx3_mp3.rb @@ -0,0 +1,13 @@ +#!/usr/bin/ruby -w + +class T_008avi_divx3_mp3 < Test + def initialize + @description = "mkvmerge / audio and video / in(divx3 + mp3 from AVI)" + end + + def run + sys("mkvmerge --engage no_variable_data -o " + tmp + " data/v.avi") + return hash_tmp + end +end + diff --git a/tests/test-009realvideo_3.rb b/tests/test-009realvideo_3.rb new file mode 100755 index 000000000..83af61202 --- /dev/null +++ b/tests/test-009realvideo_3.rb @@ -0,0 +1,13 @@ +#!/usr/bin/ruby -w + +class T_009realvideo_3 < Test + def initialize + @description = "mkvmerge / audio and video / in(RealVideo 3 and RealAudio)" + end + + def run + sys("mkvmerge --engage no_variable_data -o " + tmp + " data/rv3.rm") + return hash_tmp + end +end + diff --git a/tests/test-010realvideo_4.rb b/tests/test-010realvideo_4.rb new file mode 100755 index 000000000..fa78ae5ee --- /dev/null +++ b/tests/test-010realvideo_4.rb @@ -0,0 +1,13 @@ +#!/usr/bin/ruby -w + +class T_010realvideo_4 < Test + def initialize + @description = "mkvmerge / audio and video / in(RealVideo 4 and RealAudio)" + end + + def run + sys("mkvmerge --engage no_variable_data -o " + tmp + " data/rv4.rm") + return hash_tmp + end +end + diff --git a/tests/test-011srt.rb b/tests/test-011srt.rb new file mode 100755 index 000000000..0250d3d7e --- /dev/null +++ b/tests/test-011srt.rb @@ -0,0 +1,13 @@ +#!/usr/bin/ruby -w + +class T_011srt < Test + def initialize + @description = "mkvmerge / subtitles / in(SRT)" + end + + def run + sys("mkvmerge --engage no_variable_data -o " + tmp + " data/vde.srt") + return hash_tmp + end +end + diff --git a/tests/test-012ssa.rb b/tests/test-012ssa.rb new file mode 100755 index 000000000..9f9ece040 --- /dev/null +++ b/tests/test-012ssa.rb @@ -0,0 +1,13 @@ +#!/usr/bin/ruby -w + +class T_012ssa < Test + def initialize + @description = "mkvmerge / subtitles / in(SSA)" + end + + def run + sys("mkvmerge --engage no_variable_data -o " + tmp + " data/fe.ssa") + return hash_tmp + end +end + diff --git a/tests/test-013vobsubs.rb b/tests/test-013vobsubs.rb new file mode 100755 index 000000000..e12955450 --- /dev/null +++ b/tests/test-013vobsubs.rb @@ -0,0 +1,14 @@ +#!/usr/bin/ruby -w + +class T_013vobsubs < Test + def initialize + @description = "mkvmerge / subtitles / in(VobSub)" + end + + def run + sys("mkvmerge --engage no_variable_data -o " + tmp + + " data/ally1-short.idx") + return hash_tmp + end +end + diff --git a/tests/test-014splitting_by_size.rb b/tests/test-014splitting_by_size.rb new file mode 100755 index 000000000..2a319a11c --- /dev/null +++ b/tests/test-014splitting_by_size.rb @@ -0,0 +1,25 @@ +#!/usr/bin/ruby -w + +class T_014splitting_by_size < Test + def initialize + @description = "mkvmerge / splitting by file size / in(AVI)" + end + + def run + sys("mkvmerge --engage no_variable_data -o " + tmp + "-%03d " + + "--split-max-files 2 --split 4m data/v.avi") + if (!FileTest.exist?(tmp + "-001")) + error("First split file does not exist.") + end + if (!FileTest.exist?(tmp + "-002")) + File.unlink(tmp + "-001") + error("Second split file does not exist.") + end + hash = hash_file(tmp + "-001") + "-" + hash_file(tmp + "-002") + File.unlink(tmp + "-001") + File.unlink(tmp + "-002") + + return hash + end +end + diff --git a/tests/test-015splitting_by_time.rb b/tests/test-015splitting_by_time.rb new file mode 100644 index 000000000..333b44caa --- /dev/null +++ b/tests/test-015splitting_by_time.rb @@ -0,0 +1,25 @@ +#!/usr/bin/ruby -w + +class T_015splitting_by_time < Test + def initialize + @description = "mkvmerge / splitting by time / in(AVI)" + end + + def run + sys("mkvmerge --engage no_variable_data -o " + tmp + "-%03d " + + "--split-max-files 2 --split 20s data/v.avi") + if (!FileTest.exist?(tmp + "-001")) + error("First split file does not exist.") + end + if (!FileTest.exist?(tmp + "-002")) + File.unlink(tmp + "-001") + error("Second split file does not exist.") + end + hash = hash_file(tmp + "-001") + "-" + hash_file(tmp + "-002") + File.unlink(tmp + "-001") + File.unlink(tmp + "-002") + + return hash + end +end +