[tap-l] pgTAP
Shlomi Fish
shlomif at iglu.org.il
Wed Jun 11 21:57:35 UTC 2008
On Wednesday 11 June 2008, David E. Wheeler wrote:
> Hey all,
>
> I just wanted to mention that I've "ported" Test::More to PostgreSQL.
> Yes, you heard right. Details here:
>
>
> http://justatheory.com/computers/databases/postgresql/introducing_pgtap.htm
>l
>
> The project page for it should appear here in a day or two:
>
> http://pgfoundry.org/projects/pgtap/
>
> It includes a Perl app, pg_prove, that works just like prove, but use
> psql under the hood, and has relevant options for it. Thanks to Ovid
> and Andy for TAP::Harness -- it made it really easy!
>
> But a quick question: I'm going to start writing SQL unit tests in an
> Catalyst app I'm building. I'm thinking that the SQL tests will be
> right next to the Perl tests. So they'd be t/*.s to complement the t/
> *.t Perl tests. So the question: How do I modify `make test` and/or `./
> Build test` so that they can use a single TAP::Harness to process both
> types of tests, but send *.t tests to Perl and *.s tests to psql?
>
You can do that with Test::Run:
http://search.cpan.org/dist/Test-Run-Plugin-AlternateInterpreters/
What I normally do is create a "runtest" target that runs tests using
Test::Run:
http://search.cpan.org/src/SHLOMIF/Test-Run-Plugin-AlternateInterpreters-0.0105/inc/Test/Run/Builder.pm
But you can also overwrite the built-in Module::Build test targets to do
something else.
Regards,
Shlomi Fish
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
The Case for File Swapping - http://xrl.us/bjn7i
The bad thing about hardware is that it sometimes works and sometimes doesn't.
The good thing about software is that it's consistent: it always does not
work, and it always does not work in exactly the same way.
More information about the tap-l
mailing list