File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -818,6 +818,8 @@ make check PROVE_TESTS='t/001_test1.pl t/003_test3.pl'
818
818
<programlisting>
819
819
PG_TEST_NOCLEAN=1 make -C src/bin/pg_dump check
820
820
</programlisting>
821
+ This environment variable also prevents the test's temporary directories
822
+ from being removed.
821
823
</para>
822
824
823
825
<para>
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ sub all_tests_passing
272
272
273
273
Securely create a temporary directory inside C<$tmp_check > , like C<mkdtemp > ,
274
274
and return its name. The directory will be removed automatically at the
275
- end of the tests.
275
+ end of the tests, unless the environment variable PG_TEST_NOCLEAN is provided .
276
276
277
277
If C<prefix > is given, the new directory is templated as C<${prefix}_XXXX > .
278
278
Otherwise the template is C<tmp_test_XXXX > .
@@ -286,7 +286,7 @@ sub tempdir
286
286
return File::Temp::tempdir(
287
287
$prefix . ' _XXXX' ,
288
288
DIR => $tmp_check ,
289
- CLEANUP => 1 );
289
+ CLEANUP => not defined $ENV { ' PG_TEST_NOCLEAN ' } );
290
290
}
291
291
292
292
=pod
@@ -301,7 +301,8 @@ name, to avoid path length issues.
301
301
sub tempdir_short
302
302
{
303
303
304
- return File::Temp::tempdir(CLEANUP => 1);
304
+ return File::Temp::tempdir(
305
+ CLEANUP => not defined $ENV {' PG_TEST_NOCLEAN' });
305
306
}
306
307
307
308
=pod
Original file line number Diff line number Diff line change @@ -31,8 +31,9 @@ some lesser number of seconds.
31
31
32
32
Data directories will also be left behind for analysis when a test fails;
33
33
they are named according to the test filename. But if the environment
34
- variable PG_TEST_NOCLEAN is set, data directories will be retained
35
- regardless of test status.
34
+ variable PG_TEST_NOCLEAN is set, the data directories will be retained
35
+ regardless of test status. This environment variable also prevents the
36
+ test's temporary directories from being removed.
36
37
37
38
38
39
Writing tests
You can’t perform that action at this time.
0 commit comments