Set environment variable:
DBIC_TRACE=1
Pretty printing is available, as of DBIx::Class 0.08124:
DBIC_TRACE_PROFILE=console DBIC_TRACE=1
(sources: CPAN docs, and a foolish manifesto blog)
For plain DBI calls, see also:
DBI_TRACE=1
(source)
A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.
Jump to
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
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.
Labels:
debugging,
perl,
productivity,
testing
Enable/disable Lenovo touchpad
Press Fn + F8
(F8 should have a picture of a touchpad with a line through it)
(F8 should have a picture of a touchpad with a line through it)
Subscribe to:
Posts (Atom)