Test::S...urceTree(3)

πŸ“¦
version 1.84 Β· 2 versions
, in fedora 43

πŸ‘‘ Test::S...urceTree β€” like, the Test::Smoke::SourceTree page, but make it cute

okay so bestie, welcome to the manual page for Test::Smoke::SourceTree, which lives in the User Contributed Perl Documentation section (that's the (3) vibe). If you've ever needed to poke at a perl source-tree and be like "hmm what even is in here", this module is literally your girl. πŸŽ€


✨ NAME ✨

Test::Smoke::SourceTree β€” manipulate the perl source-tree πŸ’…


🌸 SYNOPSIS 🌸

use Test::Smoke::SourceTree qw( :mani_const );

my $tree = Test::Smoke::SourceTree->new( $tree_dir );

my $mani_check = $tree->check_MANIFEST;
foreach my $file ( sort keys %$mani_check ) {
    if ( $mani_check->{ $file } == ST_MISSING ) {
        print "MANIFEST declared '$file' but it is missing\n";
    } elsif ( $mani_check->{ $file } == ST_UNDECLARED ) {
        print "MANIFEST did not declare '$file'\n";
    }
}

$tree->clean_from_MANIFEST;

see how it's giving "import the constants, build a tree, check the MANIFEST, then clean up"? iconic behavior honestly. πŸ¦‹


⭐ CONSTANTS ⭐

two lil guys you can import (peep that :mani_const tag up in the synopsis):

  • ST_MISSING
  • ST_UNDECLARED

πŸ’– DESCRIPTION πŸ’–

🧚 Test::Smoke::SourceTree->new( $tree_dir[, $verbose] )

new() creates a new object, and it is a simple scalar containing File::Spec->rel2abs( $tree_dir).

🧚 $tree->tree_dir

Get the directory. that's it, that's the whole method.

🧚 $tree->verbose

Get verbosity.

🧚 $tree->canonpath( )

canonpath() returns the canonical name for the path β€” go peek at File::Spec for the deets.

🧚 $tree->rel2abs( [$base_dir] )

rel2abs() returns the absolute path β€” again, File::Spec has the lore.

🧚 $tree->abs2rel( [$base_dir] )

abs2rel() returns a relative path β€” yep, File::Spec again bestie.

🧚 $tree->mani2abs( $file[, $base_path] )

mani2abs() returns the absolute filename of $file, which should be in "MANIFEST" format (i.e. using '/' as directory separator).

🧚 $tree->mani2absdir( $dir[, $base_path] )

mani2abs() returns the absolute dirname of $dir, which should be in "MANIFEST" format (i.e. using '/' as directory separator).

(yes, the docs really do say mani2abs() here even though the method is mani2absdir() β€” not me fixing it, just reporting it fr fr πŸ™ˆ)

🧚 $tree->abs2mani( $file )

abs2mani() returns the MANIFEST style filename. reverse direction, we love a two-way street.

πŸ”₯ $tree->check_MANIFEST( @ignore )

check_MANIFEST() reads the MANIFEST file from $self->tree_dir and compares it with the actual contents of $self->tree_dir.

It returns a hashref with suspicious entries (if any) as keys that have a value of either ST_MISSING (not in directory) or ST_UNDECLARED (not in MANIFEST).

heads up: that's the whole point of the constants β€” you compare against them, so you know which kind of sus you're looking at.

🧚 $self->_read_mani_file( $path[, $no_croak] )

_read_mani_file() reads the contents of $path like it is a MANIFEST typeof file and returns a ref to hash with all values set "ST_MISSING". note the underscore, she's private, don't be weird about it.

🧚 $tree->clean_from_MANIFEST( )

clean_from_MANIFEST() removes all files from the source-tree that are not declared in the MANIFEST file.

⚠️ real talk: this one deletes files from your source-tree. Anything not in the MANIFEST? gone. Periodt. πŸ’€

🧚 copy_from_MANIFEST( $dest_dir )

_copy_from_MANIFEST() uses the MANIFEST file from "$self-"tree_dir> to copy a source-tree to $dest_dir.


(c) 2002-2015, All rights reserved.

  • Abe Timmerman <abeltje@cpan.org>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See:

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


and that's the whole page bestie, you ate it πŸ’…βœ¨ this lil manual came courtesy of perl v5.42.0, dated 2025-07-25, and it's filed under Test::S...urceTree(3) in the User Contributed Perl Documentation. 🫢🌸 byeeee

πŸ“¦ where this page comes from