Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joemcmahon/devel-testembed
Embed Test::More development in the debugger (Devel::Command ancestor)
https://github.com/joemcmahon/devel-testembed
Last synced: 11 days ago
JSON representation
Embed Test::More development in the debugger (Devel::Command ancestor)
- Host: GitHub
- URL: https://github.com/joemcmahon/devel-testembed
- Owner: joemcmahon
- License: other
- Created: 2009-08-20T23:41:09.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2009-08-20T23:41:34.000Z (over 15 years ago)
- Last Synced: 2024-10-28T15:48:18.247Z (about 2 months ago)
- Language: Perl
- Homepage:
- Size: 85.9 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
Devel::TestEmbed demonstrates a way of adding new commands to the debugger
without actually modifying the debugger at all.It automatically loads Test::More for you, then simulates a new command,
tdump, via the debugger's afterinit() and watchfunction() hooks (along with
some magic involving __PACKAGE__ and eval'ed glob assignments).If you use Test::More's tests (is(), ok(), etc.) during a debugger session,
tdump can then dump the tests out to a test file (you pick a name) with the
proper test plan already in place.Like this:
DB<5> use_ok("MyModule");
ok 1 - use MyModule;DB<6> $arg1 = "something";
DB<7> # set first argument
DB<8> $arg2 = "yadda yadda";
DB<9> # Set second argument
DB<10> $try_it = MyModule->new($arg1, $arg2)
DB<11> # Create an object
DB<12> isa_ok($try_it, "MyModule")
DB<13> tdump "001basic.t"
Recording tests for this session in 001basic.t ... done (2 tests).DB<14>
tdump will follow you from file to file and will always be available, no
matter what namespace you are in.To install:
perl Makefile.PL
make
make test
make install
cp scripts/perldb.sample ${HOME}/.perldbWindows users should copy the perldb.sample file to perldb.ini.
If you're interested in seeing a presentation on how this works, go to
http://ibiblio.org/mcmahon/lazy_testing.html - Firefox is recommended for
viewing this presentation; Safari will stop showing slides after a while.