Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 395585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:28:07+00:00 2026-05-12T16:28:07+00:00

After having accumulated enough tests that running them all takes some real time, I

  • 0

After having accumulated enough tests that running them all takes some real time, I looked at the Test::Class::Load doc to find a tip for running individual test classes. It provides a manner to do this, but I must be missing something, because I can’t make it work. Here’s what I have:

My test directory:

drewfus:~/sandbox$ ls t/
lib/  perlcriticrc  PerlCritic.t  Unit.t

t/Unit.t consists of the following:

use strict;
use warnings;

use Test::Class;
use Test::More 'no_plan';
use Test::Class::Load 't/lib';

Per the suggestion in the Test::Class::Load doc, I have a base class for each of my test classes to inherit from, SG::TestBase that lives at t/lib/SG/TestBase.pm:

package SG::TestBase;
use strict;
use warnings;
use base 'Test::Class';

INIT { Test::Class->runtests }

1;

And finally, here is an example test class, SG::UtilsTest at t/lib/SG/UtilsTest.pm:

package SG::UtilsTest;
use strict;
use warnings;
use base 'SG::TestBase';

BEGIN { use_ok('SG::Utils') };
<etc>

Everything is still peachy if I want to run all of the tests with Build test or prove, but trying to run an individual test doesn’t work:

drewfus:~/sandbox$  prove -lv SG::UtilsTest
Cannot determine source for SG::UtilsTest at /usr/share/perl/5.10/App/Prove.pm line 496
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:28:07+00:00Added an answer on May 12, 2026 at 4:28 pm

    Congratulations on spotting the mistake in the documentation 🙂

    The final argument should be the path to the test class – not the package name. You’ll also need to add the path to the test class libraries so prove can find them Doing:

      prove -lv -It/lib t/lib/SG/UtilsTest.pm
    

    should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After having looked at each of these two projects, it seems that both are
After having some trouble with object deletion, I ran a simple test: Created a
After having upgraded to XCode 4 im getting some linker warnings that Im a
After having read that QuickSilver was no longer supported by BlackTree and has since
After having ripped all my mother's DVD library to a Drobo-FS I setup for
After having the unpleasant surprise that Comma Seperated Value (CSV) files are not necessarily
After having solved every of my previous issues to get the code running for
After having some readings about Doxygen I'm a bit confused where to document my
After having some problems with these two linker errors on SO , I have
After having learnt the hard way that shared variables are currently not guarded by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.