pgTAP Integration

So you've caught the database testing bug and now you want to integrate pgTAP tests into your project's test suite. Excellent. You've come to the right place. Just find your favorite programming language below and follow along. Don't see your language here yet? If you figure out how to do it, please send us the instructions!

Perl

Chances are, if you're writing Perl applications, you're already using Test::More and Test::Harness to write and run your tests. If you use Module::Build to build your application, here's how to hook in pgTAP tests so that they run right along with your Perl tests.

Requirements

Instructions

Support for running pgTAP tests with ExtUtils::MakeMaker is planned, as well. Just bug Schwern to commit the patch and release a new version!

PHP

We're sure there's a way to integrate pgTAP tests with PHPUnit or SnapTest. If you figure it out, please send the instructions to the pgtap-users mail list and we'll add them to this page!

Python

We're sure there's a way to integrate pgTAP tests with PyUnit. Certainly with PyTAP. If you figure it out, please send the instructions to the pgtap-users mail list and we'll add them to this page!

PostgreSQL

If you're developing an add-on module for PostgreSQL, it can be very useful to do test-driven development with pgTAP and pg_prove. But once things are working, it's also handy to allow such tests to be run via make installcheck, which uses pg_regress to run tests and to diff their output to that found in expected output files. So here's how to do that with pgTAP while keeping everything TAPish.

Instructions