From 1932c998cac488d6ba27789fea56bcf3a554a35c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 4 Mar 2011 12:22:22 +0100 Subject: Switch from Makefile to Build.PL --- .gitignore | 4 ++- Build.PL | 22 ++++++++++++++++ Makefile | 35 -------------------------- README | 25 +++++++++++++------ bin/comirror | 2 ++ t/00-compile.t | 8 ++++++ t/10-pod-coverage.t | 8 ++++++ t/50-comirror.t | 59 +++++++++++++++++++++++++++++++++++++++++++ t/60-comirror-setup.t | 62 ++++++++++++++++++++++++++++++++++++++++++++++ t/next-loop/1.jpg | 0 t/next-loop/1.xhtml | 14 +++++++++++ t/next-loop/2.jpg | 0 t/next-loop/2.xhtml | 14 +++++++++++ t/next-loop/3.jpg | 0 t/next-loop/3.xhtml | 14 +++++++++++ t/next-loop/4.jpg | 0 t/next-loop/4.xhtml | 14 +++++++++++ t/next-loop/5.jpg | 0 t/next-loop/5.xhtml | 14 +++++++++++ t/next-none/1.jpg | 0 t/next-none/1.xhtml | 14 +++++++++++ t/next-none/2.jpg | 0 t/next-none/2.xhtml | 14 +++++++++++ t/next-none/3.jpg | 0 t/next-none/3.xhtml | 14 +++++++++++ t/next-none/4.jpg | 0 t/next-none/4.xhtml | 14 +++++++++++ t/next-none/5.jpg | 0 t/next-none/5.xhtml | 13 ++++++++++ t/next-unicroak/1.jpg | 0 t/next-unicroak/1.xhtml | 14 +++++++++++ t/next-unicroak/2.jpg | 0 t/next-unicroak/2.xhtml | 14 +++++++++++ t/next-unicroak/3.jpg | 0 t/next-unicroak/3.xhtml | 14 +++++++++++ t/next-unicroak/4.jpg | 0 t/next-unicroak/4.xhtml | 14 +++++++++++ t/next-unicroak/5.jpg | 0 t/next-unicroak/5.xhtml | 13 ++++++++++ test/00-compile.t | 8 ------ test/10-pod-coverage.t | 8 ------ test/50-comirror.t | 59 ------------------------------------------- test/60-comirror-setup.t | 62 ---------------------------------------------- test/next-loop/1.jpg | 0 test/next-loop/1.xhtml | 14 ----------- test/next-loop/2.jpg | 0 test/next-loop/2.xhtml | 14 ----------- test/next-loop/3.jpg | 0 test/next-loop/3.xhtml | 14 ----------- test/next-loop/4.jpg | 0 test/next-loop/4.xhtml | 14 ----------- test/next-loop/5.jpg | 0 test/next-loop/5.xhtml | 14 ----------- test/next-none/1.jpg | 0 test/next-none/1.xhtml | 14 ----------- test/next-none/2.jpg | 0 test/next-none/2.xhtml | 14 ----------- test/next-none/3.jpg | 0 test/next-none/3.xhtml | 14 ----------- test/next-none/4.jpg | 0 test/next-none/4.xhtml | 14 ----------- test/next-none/5.jpg | 0 test/next-none/5.xhtml | 13 ---------- test/next-unicroak/1.jpg | 0 test/next-unicroak/1.xhtml | 14 ----------- test/next-unicroak/2.jpg | 0 test/next-unicroak/2.xhtml | 14 ----------- test/next-unicroak/3.jpg | 0 test/next-unicroak/3.xhtml | 14 ----------- test/next-unicroak/4.jpg | 0 test/next-unicroak/4.xhtml | 14 ----------- test/next-unicroak/5.jpg | 0 test/next-unicroak/5.xhtml | 13 ---------- 73 files changed, 390 insertions(+), 388 deletions(-) create mode 100644 Build.PL delete mode 100644 Makefile create mode 100755 t/00-compile.t create mode 100755 t/10-pod-coverage.t create mode 100755 t/50-comirror.t create mode 100755 t/60-comirror-setup.t create mode 100644 t/next-loop/1.jpg create mode 100644 t/next-loop/1.xhtml create mode 100644 t/next-loop/2.jpg create mode 100644 t/next-loop/2.xhtml create mode 100644 t/next-loop/3.jpg create mode 100644 t/next-loop/3.xhtml create mode 100644 t/next-loop/4.jpg create mode 100644 t/next-loop/4.xhtml create mode 100644 t/next-loop/5.jpg create mode 100644 t/next-loop/5.xhtml create mode 100644 t/next-none/1.jpg create mode 100644 t/next-none/1.xhtml create mode 100644 t/next-none/2.jpg create mode 100644 t/next-none/2.xhtml create mode 100644 t/next-none/3.jpg create mode 100644 t/next-none/3.xhtml create mode 100644 t/next-none/4.jpg create mode 100644 t/next-none/4.xhtml create mode 100644 t/next-none/5.jpg create mode 100644 t/next-none/5.xhtml create mode 100644 t/next-unicroak/1.jpg create mode 100644 t/next-unicroak/1.xhtml create mode 100644 t/next-unicroak/2.jpg create mode 100644 t/next-unicroak/2.xhtml create mode 100644 t/next-unicroak/3.jpg create mode 100644 t/next-unicroak/3.xhtml create mode 100644 t/next-unicroak/4.jpg create mode 100644 t/next-unicroak/4.xhtml create mode 100644 t/next-unicroak/5.jpg create mode 100644 t/next-unicroak/5.xhtml delete mode 100755 test/00-compile.t delete mode 100755 test/10-pod-coverage.t delete mode 100755 test/50-comirror.t delete mode 100755 test/60-comirror-setup.t delete mode 100644 test/next-loop/1.jpg delete mode 100644 test/next-loop/1.xhtml delete mode 100644 test/next-loop/2.jpg delete mode 100644 test/next-loop/2.xhtml delete mode 100644 test/next-loop/3.jpg delete mode 100644 test/next-loop/3.xhtml delete mode 100644 test/next-loop/4.jpg delete mode 100644 test/next-loop/4.xhtml delete mode 100644 test/next-loop/5.jpg delete mode 100644 test/next-loop/5.xhtml delete mode 100644 test/next-none/1.jpg delete mode 100644 test/next-none/1.xhtml delete mode 100644 test/next-none/2.jpg delete mode 100644 test/next-none/2.xhtml delete mode 100644 test/next-none/3.jpg delete mode 100644 test/next-none/3.xhtml delete mode 100644 test/next-none/4.jpg delete mode 100644 test/next-none/4.xhtml delete mode 100644 test/next-none/5.jpg delete mode 100644 test/next-none/5.xhtml delete mode 100644 test/next-unicroak/1.jpg delete mode 100644 test/next-unicroak/1.xhtml delete mode 100644 test/next-unicroak/2.jpg delete mode 100644 test/next-unicroak/2.xhtml delete mode 100644 test/next-unicroak/3.jpg delete mode 100644 test/next-unicroak/3.xhtml delete mode 100644 test/next-unicroak/4.jpg delete mode 100644 test/next-unicroak/4.xhtml delete mode 100644 test/next-unicroak/5.jpg delete mode 100644 test/next-unicroak/5.xhtml diff --git a/.gitignore b/.gitignore index 84c048a..eb7253e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/build/ +/blib/ +/_build/ +/Build diff --git a/Build.PL b/Build.PL new file mode 100644 index 0000000..4d7399f --- /dev/null +++ b/Build.PL @@ -0,0 +1,22 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Module::Build; + +my $build = Module::Build->new( + build_requires => { + 'Test::Cmd' => 0, + 'Test::Compile' => 0, + 'Test::More' => 0, + 'Test::Pod' => 0, + }, + dist_name => 'comirror', + dist_version_from => 'bin/comirror', + license => 'unrestricted', + requires => { + 'perl' => '5.10.0', + 'WWW::Mechanize' => 0, + }, +); +$build->create_build_script(); diff --git a/Makefile b/Makefile deleted file mode 100644 index 1879fd1..0000000 --- a/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -PREFIX ?= /usr/local - -main_dir = ${DESTDIR}${PREFIX} -bin_dir = ${main_dir}/bin -man_dir = ${main_dir}/share/man - -all: build/comirror.1 build/comirror-setup.1 - -build/%.1: bin/% - @echo POD $< - @mkdir -p build - @pod2man $< > $@ - -install: all - @echo Installing executables to ${bin_dir} - @echo Installing manuals to ${man_dir} - @mkdir -p ${bin_dir} ${man_dir}/man1 - @cp bin/comirror ${bin_dir}/comirror - @cp bin/comirror-setup ${bin_dir}/comirror-setup - @cp build/comirror.1 ${man_dir}/man1/comirror.1 - @cp build/comirror-setup.1 ${man_dir}/man1/comirror-setup.1 - @chmod 755 ${bin_dir}/comirror ${bin_dir}/comirror-setup - @chmod 644 ${man_dir}/man1/comirror.1 ${man_dir}/man1/comirror-setup.1 - -test: - @prove test - -uninstall: - rm -f ${bin_dir}/comirror ${bin_dir}/comirror-setup - rm -f ${man_dir}/man1/comirror.1 ${man_dir}/man1/comirror-setup.1 - -clean: - rm -rf build - -.PHONY: all clean install test uninstall diff --git a/README b/README index a57fdeb..b5381d6 100644 --- a/README +++ b/README @@ -1,16 +1,27 @@ -comirror is an automated mirrorer for webcomics and image gallerys. +comirror - automated mirrorer for webcomics and image gallerys +-------------------------------------------------------------- + +Dependencies +------------ -Requires: * perl >= 5.10 * WWW::Mechanize -For testing: +Installation +------------ + +$ perl Build.PL +$ perl Build +$ sudo perl Build install + +Testing +------- + +Requires: * Test::Cmd * Test::Compile * Test::More * Test::Pod -Installation: -> make -> make test # optional -> sudo make install +Run: +$ perl Build test diff --git a/bin/comirror b/bin/comirror index 726e169..453a46b 100755 --- a/bin/comirror +++ b/bin/comirror @@ -9,6 +9,8 @@ my $mech = WWW::Mechanize->new( stack_depth => 2, ); +our $VERSION = '0.1'; + my %conf = file_to_hash('comirror.conf'); my %state = file_to_hash('comirror.state'); my $uri = shift || $state{'uri'}; diff --git a/t/00-compile.t b/t/00-compile.t new file mode 100755 index 0000000..d7b89cb --- /dev/null +++ b/t/00-compile.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.010; +use Test::More; +use Test::Compile; + +all_pl_files_ok(qw{ bin/comirror bin/comirror-setup }); diff --git a/t/10-pod-coverage.t b/t/10-pod-coverage.t new file mode 100755 index 0000000..df81177 --- /dev/null +++ b/t/10-pod-coverage.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.010; +use Test::More; +use Test::Pod; + +all_pod_files_ok(qw{ bin/comirror bin/comirror-setup }); diff --git a/t/50-comirror.t b/t/50-comirror.t new file mode 100755 index 0000000..6adc23c --- /dev/null +++ b/t/50-comirror.t @@ -0,0 +1,59 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.010; +use Cwd; +use Test::More tests => 26; +use Test::Cmd; + +sub check_key { + my ($test, $filetype, $key, $value) = @_; + my @lines; + $test->read(\@lines, "comirror.${filetype}"); + + if(grep { $_ eq "$key\t$value\n" } @lines) { + pass("${filetype}: ${key} = ${value}"); + } + else { + fail("${filetype}: ${key} = ${value}"); + } +} + +for my $next_type (qw/ loop none /) { + + my $test = Test::Cmd->new( prog => 'bin/comirror', workdir => q{} ); + my $cwd = $test->workdir(); + + my $next_base = 'file://' . getcwd() . "/t/next-${next_type}"; + my ($str, $exit); + + ok($test, "Create Test::Cmd object ($next_type)"); + + $test->write('comirror.conf', "image_re\t${next_base}/.+\n"); + + $exit = $test->run( + chdir => $cwd, + args => "${next_base}/1.xhtml", + ); + + ok($exit == 0, 'First run: return 0'); + + isnt($test->stdout, q{}, 'First run: Non-empty stdout'); + is ($test->stderr, q{}, 'First run: Empty stderr'); + + check_key($test, 'state', 'uri', "${next_base}/4.xhtml"); + + for my $i (1 .. 5) { + ok(-e "$cwd/$i.jpg", + "$i.jpg was downloaded successfully ($next_type)"); + } + + $exit = $test->run( + chdir => $cwd, + ); + + ok(($exit >> 8) == 1, 'Second run: return 1 (no new images loaded)'); + + isnt($test->stdout, q{}, 'Second run: Non-empty stdout'); + is ($test->stderr, q{}, 'Second run: Empty stderr'); +} diff --git a/t/60-comirror-setup.t b/t/60-comirror-setup.t new file mode 100755 index 0000000..a487185 --- /dev/null +++ b/t/60-comirror-setup.t @@ -0,0 +1,62 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.010; +use Cwd; +use Test::More tests => 18; +use Test::Cmd; + +my $test; + +sub check_key { + my ($filetype, $key, $value) = @_; + my @lines; + $test->read(\@lines, "comirror.${filetype}"); + + if(grep { $_ eq "$key\t$value\n" } @lines) { + pass("${filetype}: ${key} = ${value}"); + } + else { + fail("${filetype}: ${key} = ${value}"); + } +} + +for my $test_type (qw/loop unicroak/) { + + $test = Test::Cmd->new( prog => 'bin/comirror-setup', workdir => q{} ); + my $cwd = $test->workdir(); + + my $next_base = 'file://' . getcwd() . "/t/next-${test_type}"; + my ($str, $exit); + my @links; + + ok($test, 'Create Test::Cmd object'); + + $exit = $test->run( + chdir => $cwd + ); + + ok($exit != 0, 'Not enough arguments: non-zero return'); + + is ($test->stdout, q{}, 'Not enough arguments: Nothing to stdout'); + isnt($test->stderr, q{}, 'Not enough arguments: Something to stderr'); + + for my $i (1 .. 5) { + push(@links, "${next_base}/${i}.xhtml"); + } + + $exit = $test->run( + chdir => $cwd, + args => '--batch ' . join(q{ }, @links[0, 1, 3]), + ); + + ok($exit == 0, 'Correct usage: return zero'); + + isnt($test->stdout, q{}, 'Correct usage: Something to stdout'); + is ($test->stderr, q{}, 'Correct usage: Nothing to stderr'); + + check_key('state', 'uri', $links[0]); + + check_key('conf', 'image_re', "${next_base}/.+"); + +} diff --git a/t/next-loop/1.jpg b/t/next-loop/1.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-loop/1.xhtml b/t/next-loop/1.xhtml new file mode 100644 index 0000000..c0efc65 --- /dev/null +++ b/t/next-loop/1.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next => +
+ + diff --git a/t/next-loop/2.jpg b/t/next-loop/2.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-loop/2.xhtml b/t/next-loop/2.xhtml new file mode 100644 index 0000000..60e57e1 --- /dev/null +++ b/t/next-loop/2.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next => +
+ + diff --git a/t/next-loop/3.jpg b/t/next-loop/3.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-loop/3.xhtml b/t/next-loop/3.xhtml new file mode 100644 index 0000000..97eadf4 --- /dev/null +++ b/t/next-loop/3.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next => +
+ + diff --git a/t/next-loop/4.jpg b/t/next-loop/4.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-loop/4.xhtml b/t/next-loop/4.xhtml new file mode 100644 index 0000000..b0cf520 --- /dev/null +++ b/t/next-loop/4.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next => +
+ + diff --git a/t/next-loop/5.jpg b/t/next-loop/5.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-loop/5.xhtml b/t/next-loop/5.xhtml new file mode 100644 index 0000000..86ff9e8 --- /dev/null +++ b/t/next-loop/5.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next => +
+ + diff --git a/t/next-none/1.jpg b/t/next-none/1.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-none/1.xhtml b/t/next-none/1.xhtml new file mode 100644 index 0000000..c0efc65 --- /dev/null +++ b/t/next-none/1.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next => +
+ + diff --git a/t/next-none/2.jpg b/t/next-none/2.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-none/2.xhtml b/t/next-none/2.xhtml new file mode 100644 index 0000000..60e57e1 --- /dev/null +++ b/t/next-none/2.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next => +
+ + diff --git a/t/next-none/3.jpg b/t/next-none/3.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-none/3.xhtml b/t/next-none/3.xhtml new file mode 100644 index 0000000..97eadf4 --- /dev/null +++ b/t/next-none/3.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next => +
+ + diff --git a/t/next-none/4.jpg b/t/next-none/4.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-none/4.xhtml b/t/next-none/4.xhtml new file mode 100644 index 0000000..b0cf520 --- /dev/null +++ b/t/next-none/4.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next => +
+ + diff --git a/t/next-none/5.jpg b/t/next-none/5.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-none/5.xhtml b/t/next-none/5.xhtml new file mode 100644 index 0000000..41012d9 --- /dev/null +++ b/t/next-none/5.xhtml @@ -0,0 +1,13 @@ + + + + + + + +
+ +
+ + diff --git a/t/next-unicroak/1.jpg b/t/next-unicroak/1.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-unicroak/1.xhtml b/t/next-unicroak/1.xhtml new file mode 100644 index 0000000..9753197 --- /dev/null +++ b/t/next-unicroak/1.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next → +
+ + diff --git a/t/next-unicroak/2.jpg b/t/next-unicroak/2.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-unicroak/2.xhtml b/t/next-unicroak/2.xhtml new file mode 100644 index 0000000..b3c3969 --- /dev/null +++ b/t/next-unicroak/2.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next → +
+ + diff --git a/t/next-unicroak/3.jpg b/t/next-unicroak/3.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-unicroak/3.xhtml b/t/next-unicroak/3.xhtml new file mode 100644 index 0000000..b0488cf --- /dev/null +++ b/t/next-unicroak/3.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next → +
+ + diff --git a/t/next-unicroak/4.jpg b/t/next-unicroak/4.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-unicroak/4.xhtml b/t/next-unicroak/4.xhtml new file mode 100644 index 0000000..844854e --- /dev/null +++ b/t/next-unicroak/4.xhtml @@ -0,0 +1,14 @@ + + + + + + + +
+ + Next → +
+ + diff --git a/t/next-unicroak/5.jpg b/t/next-unicroak/5.jpg new file mode 100644 index 0000000..e69de29 diff --git a/t/next-unicroak/5.xhtml b/t/next-unicroak/5.xhtml new file mode 100644 index 0000000..41012d9 --- /dev/null +++ b/t/next-unicroak/5.xhtml @@ -0,0 +1,13 @@ + + + + + + + +
+ +
+ + diff --git a/test/00-compile.t b/test/00-compile.t deleted file mode 100755 index d7b89cb..0000000 --- a/test/00-compile.t +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use 5.010; -use Test::More; -use Test::Compile; - -all_pl_files_ok(qw{ bin/comirror bin/comirror-setup }); diff --git a/test/10-pod-coverage.t b/test/10-pod-coverage.t deleted file mode 100755 index df81177..0000000 --- a/test/10-pod-coverage.t +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use 5.010; -use Test::More; -use Test::Pod; - -all_pod_files_ok(qw{ bin/comirror bin/comirror-setup }); diff --git a/test/50-comirror.t b/test/50-comirror.t deleted file mode 100755 index 8ccb334..0000000 --- a/test/50-comirror.t +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use 5.010; -use Cwd; -use Test::More tests => 26; -use Test::Cmd; - -sub check_key { - my ($test, $filetype, $key, $value) = @_; - my @lines; - $test->read(\@lines, "comirror.${filetype}"); - - if(grep { $_ eq "$key\t$value\n" } @lines) { - pass("${filetype}: ${key} = ${value}"); - } - else { - fail("${filetype}: ${key} = ${value}"); - } -} - -for my $next_type (qw/ loop none /) { - - my $test = Test::Cmd->new( prog => 'bin/comirror', workdir => q{} ); - my $cwd = $test->workdir(); - - my $next_base = 'file://' . getcwd() . "/test/next-${next_type}"; - my ($str, $exit); - - ok($test, "Create Test::Cmd object ($next_type)"); - - $test->write('comirror.conf', "image_re\t${next_base}/.+\n"); - - $exit = $test->run( - chdir => $cwd, - args => "${next_base}/1.xhtml", - ); - - ok($exit == 0, 'First run: return 0'); - - isnt($test->stdout, q{}, 'First run: Non-empty stdout'); - is ($test->stderr, q{}, 'First run: Empty stderr'); - - check_key($test, 'state', 'uri', "${next_base}/4.xhtml"); - - for my $i (1 .. 5) { - ok(-e "$cwd/$i.jpg", - "$i.jpg was downloaded successfully ($next_type)"); - } - - $exit = $test->run( - chdir => $cwd, - ); - - ok(($exit >> 8) == 1, 'Second run: return 1 (no new images loaded)'); - - isnt($test->stdout, q{}, 'Second run: Non-empty stdout'); - is ($test->stderr, q{}, 'Second run: Empty stderr'); -} diff --git a/test/60-comirror-setup.t b/test/60-comirror-setup.t deleted file mode 100755 index a3ac27c..0000000 --- a/test/60-comirror-setup.t +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use 5.010; -use Cwd; -use Test::More tests => 18; -use Test::Cmd; - -my $test; - -sub check_key { - my ($filetype, $key, $value) = @_; - my @lines; - $test->read(\@lines, "comirror.${filetype}"); - - if(grep { $_ eq "$key\t$value\n" } @lines) { - pass("${filetype}: ${key} = ${value}"); - } - else { - fail("${filetype}: ${key} = ${value}"); - } -} - -for my $test_type (qw/loop unicroak/) { - - $test = Test::Cmd->new( prog => 'bin/comirror-setup', workdir => q{} ); - my $cwd = $test->workdir(); - - my $next_base = 'file://' . getcwd() . "/test/next-${test_type}"; - my ($str, $exit); - my @links; - - ok($test, 'Create Test::Cmd object'); - - $exit = $test->run( - chdir => $cwd - ); - - ok($exit != 0, 'Not enough arguments: non-zero return'); - - is ($test->stdout, q{}, 'Not enough arguments: Nothing to stdout'); - isnt($test->stderr, q{}, 'Not enough arguments: Something to stderr'); - - for my $i (1 .. 5) { - push(@links, "${next_base}/${i}.xhtml"); - } - - $exit = $test->run( - chdir => $cwd, - args => '--batch ' . join(q{ }, @links[0, 1, 3]), - ); - - ok($exit == 0, 'Correct usage: return zero'); - - isnt($test->stdout, q{}, 'Correct usage: Something to stdout'); - is ($test->stderr, q{}, 'Correct usage: Nothing to stderr'); - - check_key('state', 'uri', $links[0]); - - check_key('conf', 'image_re', "${next_base}/.+"); - -} diff --git a/test/next-loop/1.jpg b/test/next-loop/1.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-loop/1.xhtml b/test/next-loop/1.xhtml deleted file mode 100644 index c0efc65..0000000 --- a/test/next-loop/1.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next => -
- - diff --git a/test/next-loop/2.jpg b/test/next-loop/2.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-loop/2.xhtml b/test/next-loop/2.xhtml deleted file mode 100644 index 60e57e1..0000000 --- a/test/next-loop/2.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next => -
- - diff --git a/test/next-loop/3.jpg b/test/next-loop/3.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-loop/3.xhtml b/test/next-loop/3.xhtml deleted file mode 100644 index 97eadf4..0000000 --- a/test/next-loop/3.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next => -
- - diff --git a/test/next-loop/4.jpg b/test/next-loop/4.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-loop/4.xhtml b/test/next-loop/4.xhtml deleted file mode 100644 index b0cf520..0000000 --- a/test/next-loop/4.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next => -
- - diff --git a/test/next-loop/5.jpg b/test/next-loop/5.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-loop/5.xhtml b/test/next-loop/5.xhtml deleted file mode 100644 index 86ff9e8..0000000 --- a/test/next-loop/5.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next => -
- - diff --git a/test/next-none/1.jpg b/test/next-none/1.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-none/1.xhtml b/test/next-none/1.xhtml deleted file mode 100644 index c0efc65..0000000 --- a/test/next-none/1.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next => -
- - diff --git a/test/next-none/2.jpg b/test/next-none/2.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-none/2.xhtml b/test/next-none/2.xhtml deleted file mode 100644 index 60e57e1..0000000 --- a/test/next-none/2.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next => -
- - diff --git a/test/next-none/3.jpg b/test/next-none/3.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-none/3.xhtml b/test/next-none/3.xhtml deleted file mode 100644 index 97eadf4..0000000 --- a/test/next-none/3.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next => -
- - diff --git a/test/next-none/4.jpg b/test/next-none/4.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-none/4.xhtml b/test/next-none/4.xhtml deleted file mode 100644 index b0cf520..0000000 --- a/test/next-none/4.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next => -
- - diff --git a/test/next-none/5.jpg b/test/next-none/5.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-none/5.xhtml b/test/next-none/5.xhtml deleted file mode 100644 index 41012d9..0000000 --- a/test/next-none/5.xhtml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - -
- -
- - diff --git a/test/next-unicroak/1.jpg b/test/next-unicroak/1.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-unicroak/1.xhtml b/test/next-unicroak/1.xhtml deleted file mode 100644 index 9753197..0000000 --- a/test/next-unicroak/1.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next → -
- - diff --git a/test/next-unicroak/2.jpg b/test/next-unicroak/2.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-unicroak/2.xhtml b/test/next-unicroak/2.xhtml deleted file mode 100644 index b3c3969..0000000 --- a/test/next-unicroak/2.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next → -
- - diff --git a/test/next-unicroak/3.jpg b/test/next-unicroak/3.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-unicroak/3.xhtml b/test/next-unicroak/3.xhtml deleted file mode 100644 index b0488cf..0000000 --- a/test/next-unicroak/3.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next → -
- - diff --git a/test/next-unicroak/4.jpg b/test/next-unicroak/4.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-unicroak/4.xhtml b/test/next-unicroak/4.xhtml deleted file mode 100644 index 844854e..0000000 --- a/test/next-unicroak/4.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- - Next → -
- - diff --git a/test/next-unicroak/5.jpg b/test/next-unicroak/5.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/test/next-unicroak/5.xhtml b/test/next-unicroak/5.xhtml deleted file mode 100644 index 41012d9..0000000 --- a/test/next-unicroak/5.xhtml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - -
- -
- - -- cgit v1.2.3