Test::...utable(3pm)
π Test::Skip::UnlessExistsExecutable π
okay so bestie, welcome to the Test::Skip::UnlessExistsExecutable page from the User Contributed Perl Documentation manual set π β yes the header up top says Test::...utable(3pm) because even the man page title got the abbreviation treatment, but the full name is right here and it's a whole mouthful, we love that for it.
β¨ NAME β¨
Test::Skip::UnlessExistsExecutable β skips tests unless executable exists π¦
πΈ SYNOPSIS πΈ
use Test::More tests => 1;
use Test::Skip::UnlessExistsExecutable qw(
/usr/bin/rsync
perl
);
use_ok 'Mouse';
# or
use Test::More tests => 1;
use Test::Skip::UnlessExistsExecutable;
skip_all_unless_exists '/bin/sh';
skip_all_unless_exists 'perl';
ok 1;
two whole vibes, pick your fighter π
π DESCRIPTION π
Test::Skip::UnlessExistsExecutable checks if an executable exist and skips the test if it does not. lowkey the entire point is that you should never have to hand-write this kind of boilerplate code, because writing it is giving copy-paste energy and nobody has time:
Test::More;
BEGIN {
do_i_have_all_my_optional_deps() ? plan skip_all : plan tests => 42
}
no cap, that block? not the move. π«Ά
π§ INTERFACE π§
Both Test::Skip::UnlessExistsExecutable import method and test_exists_executable method take the name of a program or the file path of executable. It checks if the program exists and is executable. β¨
fr fr, that's the whole interface. either you import it with a list, or you call the method yourself β either way you're handing it a program name or a full path to an executable, and it does the vibe check: exists? executable? slay. doesn't? we skip. π
π SOURCE AVAILABILITY π
This source is in Github:
http://github.com/dann/p5-test-skip-unlessexistsexecutable
go look at it, it's iconic π₯
π AUTHOR π
dann <techmemo@gmail.com>
π SEE ALSO π
bestieβ¦ this section is literally empty. nothing here. a beautiful blank canvas. we respect it π
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, periodt π stay slaying those optional dependency checks, and remember: your tests should skip gracefully, not explode dramatically.
this was perl v5.36.0, dated 2023-02-02, from the User Contributed Perl Documentation β mwah, thanks for reading bestie π¦β¨
π¦ where this page comes from
- debian bookworm: libtest-skip-unlessexistsexecutable-perl 0.041-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtest-skip-unlessexistsexecutable-perl 0.041-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtest-skip-unlessexistsexecutable-perl 0.041-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtest-skip-unlessexistsexecutable-perl 0.041-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtest-skip-unlessexistsexecutable-perl 0.041-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms