?
Solved

how to have a Perl test Report

Posted on 2009-02-19
2
Medium Priority
?
245 Views
Last Modified: 2012-05-06
I have a project with this structure

Pack_1
    Pach_1_2
        File_1_2_1.pm
        File_1_2_2.pm
    Pack_1_3
        File_1_3_1.pm
        File_1_3_2.pm
t
    Pack_1
        Pach_1_2
            File_1_2_1.pm
            File_1_2_2.pm
        Pack_1_3
            File_1_3_1.pm
            File_1_3_2.pm

so for the file Pack_1/Pack_1_2/File_1_2_1.pm with package Pack_1::Pack_1_2::File_1_2_1, I also have the file t/Pack_1/Pack_1_2/File_1_2_1.pm with package t::Pack_1::Pack_1_2::File_1_2_1. The file t/* are test files.

So now I need to have something that runs all the tests and give me some report. Something similar to the 'make test'

thanks for any help.
0
Comment
Question by:oleber
2 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 23689939
something like:
 perl -MFile::Find -le 'find(\&testme $_,"path/to/Packs");sub testme{print "test $[0]"}'
0
 
LVL 10

Accepted Solution

by:
oleber earned 0 total points
ID: 23690074
I found it.
#!/bin/sh
BASE_ROOT='...'
cd $BASE_ROOT
TEST_FILES=`find $TEST_BASE_ROOT -name *.pm`
perl -MTest::Harness -e 'runtests @ARGV' $TEST_FILES

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
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 (http://dilbert.com/strips/comic/2007-08…
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…
Six Sigma Control Plans
Suggested Courses

840 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