Akron | 84b53ad | 2022-01-14 12:39:15 +0100 | [diff] [blame^] | 1 | #/usr/bin/env perl |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | use File::Basename 'dirname'; |
| 5 | use File::Spec::Functions qw/catdir catfile/; |
| 6 | use File::Temp qw/:POSIX/; |
| 7 | use Mojo::File; |
| 8 | use Mojo::JSON qw/decode_json/; |
| 9 | use IO::Uncompress::Gunzip; |
| 10 | use Test::More; |
| 11 | use Test::Output; |
| 12 | use Data::Dumper; |
| 13 | use utf8; |
| 14 | |
| 15 | if ($ENV{SKIP_SCRIPT}) { |
| 16 | plan skip_all => 'Skip script tests'; |
| 17 | }; |
| 18 | |
| 19 | my $f = dirname(__FILE__); |
| 20 | my $script = catfile($f, '..', '..', 'script', 'korapxml2krill'); |
| 21 | my $log = catfile($f, '..', 'logs', 'dereko-example-log.txt'); |
| 22 | |
| 23 | my $call = join(' ', 'perl', $script, 'slimlog', $log); |
| 24 | |
| 25 | # Test with compression |
| 26 | stdout_like( |
| 27 | sub { system($call); }, |
| 28 | qr!## Done\. \[\!Process: 2\]!, |
| 29 | $call |
| 30 | ); |
| 31 | |
| 32 | done_testing; |
| 33 | __END__ |
| 34 | |