Test::Requires(3) User Contributed Perl Documentation Test::Requires(3)

# [NAME](#NAME)

Test::Requires - Checks to see if the module can be loaded

# [SYNOPSIS](#SYNOPSIS)

```
    # in your Makefile.PL
    use inc::Module::Install;
    test_requires 'Test::Requires';
    # in your test
    use Test::More tests => 10;
    use Test::Requires {
        'HTTP::MobileAttribute' => 0.01, # skip all if HTTP::MobileAttribute doesn't installed
    };
    isa_ok HTTP::MobileAttribute->new, 'HTTP::MobileAttribute::NonMobile';
    # or
    use Test::More tests => 10;
    use Test::Requires qw( 
        HTTP::MobileAttribute
    );
    isa_ok HTTP::MobileAttribute->new, 'HTTP::MobileAttribute::NonMobile';
    # or
    use Test::More tests => 10;
    use Test::Requires;
    test_requires 'Some::Optional::Test::Required::Modules';
    isa_ok HTTP::MobileAttribute->new, 'HTTP::MobileAttribute::NonMobile';
```

# [DESCRIPTION](#DESCRIPTION)

Test::Requires checks to see if the module can be loaded.

If this fails rather than failing tests this **skips all tests**.

Test::Requires can also be used to require a minimum version of Perl:

```
    use Test::Requires "5.010";  # quoting is necessary!!
    
    # or
    use Test::Requires "v5.10";
```

# [AUTHOR](#AUTHOR)

Tokuhiro Matsuno &lt;tokuhirom @\*(#RJKLFHFSDLJF gmail.com&gt;

# [THANKS TO](#THANKS_TO)

```
    kazuho++ # some tricky stuff
    miyagawa++ # original code from t/TestPlagger.pm
    tomyhero++ # reported issue related older test::builder
    tobyink++ # documented that Test::Requires "5.010" works
```

# [ENVIRONMENT](#ENVIRONMENT)

If the "RELEASE\_TESTING" environment variable is true, then instead of skipping tests, Test::Requires bails out.

# [SEE ALSO](#SEE_ALSO)

"TestPlagger.pm" in t

# [LICENSE](#LICENSE)

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

2026-08-16 perl v5.44.0

---

Document: Test::Requires(3pm) from perl-test-requires 0.11-r1 (Chainguard OS)
Source: https://github.com/tokuhirom/Test-Requires
