Skip Menu |

This queue is for tickets about the FFmpeg-Command CPAN distribution.

Report information
The Basics
Id: 103139
Status: open
Priority: 0/
Queue: FFmpeg-Command

People
Owner: Nobody in particular
Requestors: nick [...] dovelane.co.uk
nick [...] oldnicksoftware.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: The tests in 06-output_options.t fail as Command Line build is not ordered consistently
Date: Fri, 27 Mar 2015 13:10:41 +0000
To: bug-FFmpeg-Command [...] rt.cpan.org
From: Nick Charsley <nick [...] dovelane.co.uk>
The tests in 06-output_options.t use an exact string compare so fails as the output options can be valid even in different orders. # Failed test at t/06-output_options.t line 62. # got: 'ffmpeg -y -i in.mp4 -ar 48000 -vcodec mpeg4 -acodec libaac -ab 64 -s 320x240 -f mp4 -b 600 out.mp4' # expected: 'ffmpeg -y -i in.mp4 -acodec libaac -b 600 -f mp4 -vcodec mpeg4 -ar 48000 -s 320x240 -ab 64 out.mp4' # Failed test at t/06-output_options.t line 112. # got: 'ffmpeg -y -i in.mp4 -b 600 -acodec libfaac -s 320x240 -ab 64 -f mp4 -ar 48000 -vcodec mpeg4 out.mp4' # expected: 'ffmpeg -y -i in.mp4 -acodec libfaac -b 600 -f mp4 -vcodec mpeg4 -ar 48000 -s 320x240 -ab 64 out.mp4' # Looks like you failed 2 tests of 46. Nick(c)
CC: Nick Charsley <nick [...] dovelane.co.uk>
Subject: [PATCH] Fix for Bug #103139 for FFmpeg-Command: The tests in 06-output_options.t fail as Command Line build is not ordered consistently Signed-off-by:Nick Charsley <nick@dovelane.co.uk>
Date: Sat, 28 Mar 2015 12:59:01 +0000
To: bug-FFmpeg-Command [...] rt.cpan.org
From: Nick Charsley <nick [...] oldnicksoftware.co.uk>
From: Nick Charsley <nick@dovelane.co.uk> --- .gitignore | 6 ++++ t/06-output_options.t | 81 ++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc19a57 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/MYMETA.json +/MYMETA.yml +/Makefile +/pm_to_blib +/blib/lib/FFmpeg/Command.pm +/blib/man3/FFmpeg::Command.3pm \ No newline at end of file diff --git a/t/06-output_options.t b/t/06-output_options.t index c96a5c8..1480a9b 100644 --- a/t/06-output_options.t +++ b/t/06-output_options.t @@ -21,11 +21,44 @@ $ffmpeg->output_options({ }); my $cmd = $ffmpeg->_compose_command; +## This was too order specific!!! +my $tst_cmd= join(' ', @$cmd); +##It will be exactly this long +is(length($tst_cmd),98); +##it will have these bits + +ok( (index $tst_cmd,$ffmpeg->ffmpeg) eq 0);##must be first item +like( $tst_cmd,qr/out.mp4$/);##Must be last item on the line +like( $tst_cmd,qr/-y/); + +like( $tst_cmd,qr/-i in.mp4/); +like( $tst_cmd,qr/-y .*-i in.mp4/); + +like( $tst_cmd,qr/-acodec libaac/); +like( $tst_cmd,qr/-i .*-acodec libaac .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-acodec libaac/); +like( $tst_cmd,qr/-i .*-acodec libaac .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-b 600/); +like( $tst_cmd,qr/-i .*-b 600 .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-f mp4/); +like( $tst_cmd,qr/-i .*-f mp4 .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-vcodec mpeg4/); +like( $tst_cmd,qr/-i .*-vcodec mpeg4 .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-ar 48000/); +like( $tst_cmd,qr/-i .*-ar 48000 .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-s 320x240/); +like( $tst_cmd,qr/-i .*-s 320x240 .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-ab 64/); +like( $tst_cmd,qr/-i .*-ab 64 .*out.mp4/);##must be after -i and before out.mp4 + -is( - join(' ', @$cmd), - $ffmpeg->ffmpeg . ' -y -i in.mp4 -acodec libaac -b 600 -f mp4 -vcodec mpeg4 -ar 48000 -s 320x240 -ab 64 out.mp4' -); $ffmpeg = FFmpeg::Command->new; $ffmpeg->input_options({ file => 'in.mp4' }); @@ -35,7 +68,39 @@ $ffmpeg->output_options({ }); $cmd = $ffmpeg->_compose_command; -is( - join(' ', @$cmd), - $ffmpeg->ffmpeg . ' -y -i in.mp4 -b 600 -acodec libfaac -f mp4 -vcodec mpeg4 -ar 48000 -s 320x240 -ab 64 out.mp4' -); +## This was too order specific!!! +$tst_cmd= join(' ', @$cmd); +##It will be exactly this long +is(length($tst_cmd),99); +##it will have these bits + +ok( (index $tst_cmd,$ffmpeg->ffmpeg) eq 0);##must be first item +like( $tst_cmd,qr/out.mp4$/);##Must be last item on the line +like( $tst_cmd,qr/-y/); + +like( $tst_cmd,qr/-i in.mp4/); +like( $tst_cmd,qr/-y .*-i in.mp4/); + +like( $tst_cmd,qr/-acodec libfaac/); +like( $tst_cmd,qr/-i .*-acodec libfaac .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-acodec libfaac/); +like( $tst_cmd,qr/-i .*-acodec libfaac .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-b 600/); +like( $tst_cmd,qr/-i .*-b 600 .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-f mp4/); +like( $tst_cmd,qr/-i .*-f mp4 .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-vcodec mpeg4/); +like( $tst_cmd,qr/-i .*-vcodec mpeg4 .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/-ar 48000/); +like( $tst_cmd,qr/-i .*-ar 48000 .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/ -s 320x240 /); +like( $tst_cmd,qr/-i .*-s 320x240 .*out.mp4/);##must be after -i and before out.mp4 + +like( $tst_cmd,qr/ -ab 64 /); +like( $tst_cmd,qr/-i .*-ab 64 .*out.mp4/);##must be after -i and before out.mp4 -- 1.9.1
Any chance getting this out soon?