2

I have been trying to install pgTAP on Windows for hours and could not figure it out.

Does anyone know how to do it?

Thanks.

UPDATE:

I installed strawberry perl and GnuWin32 in order to run Makefile.

Here are some of the errors I got:

make
'awk' is not recognized as an internal or external command
'grep' is not recognized as an internal or external command
akefile:42: C:/strawberry/c/lib/postgresql/pgxs/src/makefiles/pgxs.mk: No such file or directory
rocess_begin: CreateProcess(NULL, which perl, ...) failed.
makefile:56: To use pg_prove, TAP::Parser::SourceHandler::pgTAP Perl module
makefile:57: must be installed from CPAN. To do so, simply run:
makefile:58: cpan TAP::Parser::SourceHandler::pgTAP

I also installed Cygwin64 to run Makefile.

$ make
makefile:42: C:/Program: No such file or directory
makefile:42: Files/PostgreSQL/9.2/lib/pgxs/src/makefiles/pgxs.mk: No such file o                                  r directory
process_begin: CreateProcess(NULL, /usr/bin/perl -le "eval { require TAP::Parser                                  ::SourceHandler::pgTAP }; print 1 unless $@", ...) failed.
makefile:56: To use pg_prove, TAP::Parser::SourceHandler::pgTAP Perl module
makefile:57: must be installed from CPAN. To do so, simply run:
makefile:58: cpan TAP::Parser::SourceHandler::pgTAP
make: *** ▒^▒[▒Q▒b▒g `Files/PostgreSQL/9.2/lib/pgxs/src/makefiles/pgxs.mk' ▒▒ ma                                      ke ▒▒▒郋▒[▒▒▒▒▒▒▒▒܂▒▒▒.  ▒▒▒~.
Chris Travers
  • 25,424
  • 6
  • 65
  • 182
Xin
  • 737
  • 3
  • 10
  • 27
  • What errors are you getting? – DrColossos Aug 01 '13 at 07:32
  • Looks like file names with spaces are not properly handled in [the `Makefile`](https://github.com/theory/pgtap/blob/master/Makefile). Anyone know how to get `include $(PGXS)` to properly quote the value in `$PGXS`? – theory Nov 20 '13 at 18:11

1 Answers1

4

Since you need to use pgTAP with Postgres 9.2, you can just make a few modifications of the source file and copy it directly. See this wiki page for details. To summarize, once you have Strawberry Perl or ActivePerl installed, run these commands:

copy sql/pgtap.sql.in sql/pgtap.sql
perl.exe -pi.bak -e "s/TAPSCHEMA/tap/g" sql/pgtap.sql
perl.exe -pi.bak -e "s/__OS__/win32/g" sql/pgtap.sql
perl.exe -pi.bak -e "s/__VERSION__/0.24/g" sql/pgtap.sql
perl.exe -pi.bak -e "s/^-- ## //g" sql/pgtap.sql
copy sql/pgtap.sql "%ProgramFiles%\PostgreSQL\9.2\share" 

As for pg_prove, on Strawberry Perl, you can install from CPAN, like so:

cpan TAP::Parser::SourceHandler::pgTAP

On ActivePerl, you can install the PPM:

ppm install TAP-Parser-SourceHandler-pgTAP
theory
  • 9,178
  • 10
  • 59
  • 129
  • Any recent update for this? I have a similar problem but these patterns have changed. In particular, I would like to change the default schema (other than public...) – Eric Mamet Mar 27 '19 at 17:18