我一直试图在 Windows 上安装 pgTAP 几个小时,但无法理解。
有谁知道怎么做?
感谢。
更新:
我安装了 Strawberry 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 ▒▒▒郋▒[▒▒▒▒▒▒▒▒܂▒▒▒. ▒▒▒~.
答案 0 :(得分:2)
由于您需要在Postgres 9.2中使用pgTAP,您只需对源文件进行一些修改并直接复制即可。有关详细信息,请参阅this wiki page。总而言之,一旦安装了Strawberry Perl或ActivePerl,请运行以下命令:
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上,您可以安装from CPAN,如下所示:
cpan TAP::Parser::SourceHandler::pgTAP
在ActivePerl上,您可以安装the PPM:
ppm install TAP-Parser-SourceHandler-pgTAP