File: 99cleanup.t

package info (click to toggle)
libdbd-pg-perl 3.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,428 kB
  • sloc: perl: 10,202; ansic: 5,977; makefile: 15
file content (37 lines) | stat: -rw-r--r-- 831 bytes parent folder | download | duplicates (3)
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
35
36
37
#!perl

## Cleanup all database objects we may have created
## Shutdown the test database if we created one
## Remove the entire directory if it was created as a tempdir

use 5.008001;
use strict;
use warnings;
use lib 'blib/lib', 'blib/arch', 't';
use Test::More tests => 1;

if ($ENV{DBDPG_NOCLEANUP}) {
    pass (q{No cleaning up because ENV 'DBDPG_NOCLEANUP' is set});
    exit;
}

require 'dbdpg_test_setup.pl';
select(($|=1,select(STDERR),$|=1)[1]);

my $dbh = connect_database({nosetup => 1, nocreate => 1, norestart => 1});

SKIP: {
    if (! $dbh) {
        skip ('Connection to database failed, cannot cleanup', 1);
    }

    isnt ($dbh, undef, 'Connect to database for cleanup');

    cleanup_database($dbh);
}

$dbh->disconnect() if defined $dbh and ref $dbh;

shutdown_test_database();

unlink 'README.testdatabase';