A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Debugging Test::Class tests in Perl

Only test one method:
TEST_METHOD="Class::To::Test" prove run_all_tests.t

Script to test one class only:

#!/bin/bash


MODULE=$1
FILE="/tmp/runtest"
rm -f $FILE
echo '#!/usr/bin/perl' >> $FILE
echo "use Test::Class;" >> $FILE
echo "use Test::NoWarnings;" >> $FILE
echo "use $MODULE;" >> $FILE
echo 'Test::Class->runtests;' >> $FILE


prove -lv -It/lib -It/unit-tests/classes $FILE

Run like this:
script.sh Class::To::Test

You can combine the two commands to test one method from one class only.