Support serial conversion and input-base

Change-Id: I3225847e31c307e0b5bd3e108ae0f306d71d4395
diff --git a/t/script/archive.t b/t/script/archive.t
index 17ab672..69546c0 100644
--- a/t/script/archive.t
+++ b/t/script/archive.t
@@ -185,7 +185,7 @@
   sub {
     system($call);
   },
-  qr!Input rewritten to .+?wpd15-single\.zip,.+?wpd15-single\.malt\.zip,.+?wpd15-single\.corenlp\.zip,.+?wpd15-single\.opennlp\.zip,.+?wpd15-single\.mdparser\.zip,.+?wpd15-single\.tree_tagger\.zip!is,
+  qr!Input is .+?wpd15-single\.zip,.+?wpd15-single\.malt\.zip,.+?wpd15-single\.corenlp\.zip,.+?wpd15-single\.opennlp\.zip,.+?wpd15-single\.mdparser\.zip,.+?wpd15-single\.tree_tagger\.zip!is,
   $call
 );
 
diff --git a/t/script/config.t b/t/script/config.t
index 8af59c5..8a5f46e 100644
--- a/t/script/config.t
+++ b/t/script/config.t
@@ -14,7 +14,9 @@
 
 my ($fh, $cfg_file) = tempfile();
 
-print $fh <<CFG;
+my $input_base = catdir($f, '..', 'corpus', 'archives');
+
+print $fh <<"CFG";
 overwrite       0
 token           OpenNLP#tokens
 base-sentences  DeReKo#Structure
@@ -24,6 +26,7 @@
 meta            I5
 gzip            1
 log             DEBUG
+input-base      $input_base
 CFG
 
 close($fh);
@@ -32,7 +35,7 @@
 my $script = catfile($f, '..', '..', 'script', 'korapxml2krill');
 
 # Path for input
-my $input = "'".catfile($f, '..', 'corpus', 'archives', 'wpd15*.zip') . "'";
+my $input = "'".catfile('wpd15*.zip') . "'";
 
 # Temporary output
 my $output = File::Temp->newdir(CLEANUP => 0);
@@ -59,7 +62,7 @@
 like($stdout, qr!Unable to parse KorAP::XML::Annotation::Glemm::Morpho!, 'Check log level');
 
 # Check wildcard input
-like($stdout, qr!Input rewritten to .+?wpd15-single\.zip,.+?wpd15-single\.malt\.zip,.+?wpd15-single\.corenlp\.zip,.+?wpd15-single\.opennlp\.zip,.+?wpd15-single\.mdparser\.zip,.+?wpd15-single\.tree_tagger\.zip!is, 'Wildcards');
+like($stdout, qr!Input is .+?wpd15-single\.zip,.+?wpd15-single\.malt\.zip,.+?wpd15-single\.corenlp\.zip,.+?wpd15-single\.opennlp\.zip,.+?wpd15-single\.mdparser\.zip,.+?wpd15-single\.tree_tagger\.zip!is, 'Wildcards');
 
 like($stdout, qr!Run using \d+ jobs on \d+ cores!, 'Jobs');
 
diff --git a/t/script/serial.t b/t/script/serial.t
new file mode 100644
index 0000000..70febc3
--- /dev/null
+++ b/t/script/serial.t
@@ -0,0 +1,39 @@
+use strict;
+use warnings;
+use Test::More;
+use Test::Output;
+use File::Basename 'dirname';
+use File::Spec::Functions qw/catdir catfile/;
+use File::Temp qw/tempdir/;
+
+my $f = dirname(__FILE__);
+my $script = catfile($f, '..', '..', 'script', 'korapxml2krill');
+
+my $input_base = catdir($f, '..', 'corpus', 'archives');
+
+# Temporary output
+my $output = File::Temp->newdir(CLEANUP => 0);
+
+my $call = join(
+  ' ',
+  'perl', $script,
+  'serial',
+  '-i' => '"ngafy*.zip"',
+  '-i' => '"tree*.zip"',
+  '-ib' => $input_base,
+  '-o' => $output,
+  '-l' => 'WARN'
+);
+
+# Test without parameters
+combined_like(
+  sub {
+    system($call);
+  },
+  qr!Start serial processing of ngafy\*\.zip!s,
+  $call
+);
+
+
+done_testing;
+__END__