Test::S...urceTree(3)
π 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_MISSINGST_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.
π COPYRIGHT π
(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
- fedora 43: perl-Test-Smoke 1.84-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms