2

我一直在尝试在Windows上安装pgTAP几个小时,但无法弄清楚。

有谁知道该怎么做?

谢谢。

更新:

我安装了草莓 perl和 GnuWin32 以便运行Makefile

以下是我得到的一些错误:

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

我还安装了Cygwin64来运行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 ▒▒▒郋▒[▒▒▒▒▒▒▒▒܂▒▒▒.  ▒▒▒~.
4

1 回答 1

4

由于您需要在 Postgres 9.2 中使用 pgTAP,您只需对源文件进行一些修改并直接复制即可。有关详细信息,请参阅此 wiki 页面。总而言之,一旦你安装了Strawberry PerlActivePerl,运行这些命令:

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" 

至于pg_prove,在 Strawberry Perl 上,您可以从 CPAN安装,如下所示:

cpan TAP::Parser::SourceHandler::pgTAP

在 ActivePerl 上,您可以安装PPM

ppm install TAP-Parser-SourceHandler-pgTAP
于 2013-11-20T18:09:17.727 回答