Package Info

perl-Test-TempDir-Tiny


Temporary directories that stick around when tests fail


Development/Libraries/Perl

This module works with Test::More to create temporary directories that stick around if tests fail.

It is loosely based on Test::TempDir, but with less complexity, greater portability and zero non-core dependencies. (Capture::Tiny is recommended for testing.)

The tempdir and in_tempdir functions are exported by default.

If the current directory is writable, the root for directories will be ./tmp. Otherwise, a File::Temp directory will be created wherever temporary directories are stored for your system.

Every *.t file gets its own subdirectory under the root based on the test filename, but with slashes and periods replaced with underscores. For example, t/foo.t would get a test-file-specific subdirectory ./tmp/t_foo_t/. Directories created by tempdir get put in that directory. This makes it very easy to find files later if tests fail.

The test-file-specific name is consistent from run-to-run. If an old directory already exists, it will be removed.

When the test file exits, if all tests passed, then the test-file-specific directory is recursively removed.

If a test failed and the root directory is ./tmp, the test-file-specific directory sticks around for inspection. (But if the root is a File::Temp directory, it is always discarded).

If nothing is left in ./tmp (i.e. no other test file failed), then ./tmp is cleaned up as well (unless it's a symlink).

This module attempts to avoid race conditions due to parallel testing. In extreme cases, the test-file-specific subdirectory might be created as a regular File::Temp directory rather than in ./tmp. In such a case, a warning will be issued.


License: Apache-2.0
URL: http://search.cpan.org/dist/Test-TempDir-Tiny/

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.016-bp155.2.10 info GA Release 2023-05-17 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-TempDir-Tiny
0.016-bp154.1.22 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-TempDir-Tiny
0.016-bp153.1.15 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-TempDir-Tiny
0.016-bp152.3.15 info GA Release 2020-04-16 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-TempDir-Tiny
0.016-bp151.3.1 info GA Release 2019-07-17 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-TempDir-Tiny
0.016-bp151.2.12 info GA Release 2019-05-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-TempDir-Tiny
0.016-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-TempDir-Tiny