Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb102e80

Browse files
committed
Make PG_TEST_NOCLEAN work for temporary directories in TAP tests
When set, this environment variable was only effective for datadirectories but not for all the other temporary files created byPostgreSQL::Test::Utils. Keeping the temporary files after a successfulrun can be useful for debugging purposes.The documentation is updated to reflect the new behavior, with contentsavailable in doc/ since v16 and in src/test/perl/README since v15.Author: Jacob ChampionReviewed-by: Daniel GustafssonDiscussion:https://postgr.es/m/CAAWbhmgHtDH1SGZ+Fw05CsXtE0mzTmjbuUxLB9mY9iPKgM6cUw@mail.gmail.comDiscussion:https://postgr.es/m/YyPd9unV14SX2bLF@paquier.xyzBackpatch-through: 11
1 parent984c23f commitb102e80

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/test/perl/TestLib.pm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ sub all_tests_passing
252252
253253
Securely create a temporary directory insideC<$tmp_check>, likeC<mkdtemp>,
254254
and return its name. The directory will be removed automatically at the
255-
end of the tests.
255+
end of the tests, unless the environment variable PG_TEST_NOCLEAN is provided.
256256
257257
IfC<prefix> is given, the new directory is templated asC<${prefix}_XXXX>.
258258
Otherwise the template isC<tmp_test_XXXX>.
@@ -266,7 +266,7 @@ sub tempdir
266266
return File::Temp::tempdir(
267267
$prefix .'_XXXX',
268268
DIR=>$tmp_check,
269-
CLEANUP=>1);
269+
CLEANUP=>notdefined$ENV{'PG_TEST_NOCLEAN'});
270270
}
271271

272272
=pod
@@ -281,7 +281,8 @@ name, to avoid path length issues.
281281
subtempdir_short
282282
{
283283

284-
return File::Temp::tempdir(CLEANUP=> 1);
284+
return File::Temp::tempdir(
285+
CLEANUP=>notdefined$ENV{'PG_TEST_NOCLEAN'});
285286
}
286287

287288
=pod

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp