How to print only failed tests in Tests::More in Perl?

Posted on 2012-08-13
Last Modified: 2012-08-21
In writing test in Perl by using Tests::More, how can I just print the failed tests on the screen.

Currently, it prints all tests as ok or not ok.

Question by:Tolgar
    1 Comment
    LVL 26

    Accepted Solution

    You need to use Test::Harness.  The simplest way is to use either ExtUtils::MakeMaker or Module::Build to create a Makefile (or Build file) which will use it automatically on the test target.

    Alternately, you can use it directly.  Create a script something like this...
    use strict;
    use warnings;
    use Test::Harness;
    runtests(qw(testfile1 testfile2 testfile3 ...));

    Open in new window

    And use that script to run your tests.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
    In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now