File: 60-cleanup.t

package info (click to toggle)
libpar-perl 1.020-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 356 kB
  • sloc: perl: 1,047; makefile: 2; sh: 2
file content (36 lines) | stat: -rw-r--r-- 652 bytes parent folder | download | duplicates (8)
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
#!/usr/bin/perl
use strict;
use warnings;

# This test is supposed to make sure that
# the /tmp/par-$USER/temp-$$ directories get cleaned up when
# in CLEAN mode.

use File::Temp ();
use Test::More tests => 5;

BEGIN {
  $ENV{PAR_TMPDIR} = File::Temp::tempdir(TMPDIR => 1, CLEANUP => 1);
  $ENV{PAR_CLEAN} = 1;
  delete $ENV{PAR_TEMP};
}

ok(!defined $ENV{PAR_TEMP}, "No PAR_TEMP to start with");

require PAR;
PAR->import();

ok(1, "Loaded PAR");

ok(defined $ENV{PAR_TEMP}, "Loading PAR defined PAR_TEMP");
ok(-d $ENV{PAR_TEMP}, "Loading PAR created the PAR_TEMP directory");

my $partemp = $ENV{PAR_TEMP};

END {
  ok(not -d $partemp);
}


__END__