File: 3svnweb-install.t

package info (click to toggle)
libsvn-web-perl 0.63-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 736 kB
  • sloc: perl: 1,987; sh: 73; makefile: 11
file content (34 lines) | stat: -rw-r--r-- 799 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/perl

use warnings;
use strict;

use Test::More tests => 3;
use Cwd;
use File::Temp qw(tempdir);
use YAML ();

my $cwd = getcwd();
my $script = $ENV{AUTOPKGTEST_TMP} ?
    '/usr/bin/svnweb-install' :
    "$cwd/bin/svnweb-install";

# Make sure that it compiles cleanly
system "$^X -Iblib/lib -c $script 2>/dev/null";
is($? >> 8, 0, 'svnweb-install compiled cleanly');

# Run in a temporary directory, verify that the generated config.yaml parses
my $tmpdir = tempdir(CLEANUP => 1);
chdir($tmpdir);

system "$^X -I$cwd/blib/lib $script > /dev/null";

for my $file (qw(config.yaml)) {
    ok(-f "$tmpdir/$file", "$tmpdir/$file created");
}

my $config;
$config = eval { YAML::LoadFile('config.yaml'); };
ok(defined $config, "YAML::LoadFile('$tmpdir/config.yaml') succeeded");

chdir($cwd);