当尝试运行 make test
并看到一个测试失败时,通常会遇到此问题。自述文件描述了可以单独运行每个测试,但没有明确说明如何执行此操作。
最佳答案
make test
使用测试目录 (t
) 中名为 TEST
的脚本。要复制单个文件的 make test
,可以按如下方式使用此脚本:
[.../perl/t]$ ./perl -I../lib TEST op/array.t
t/op/array ... ok
All tests successful.
Elapsed: 0 sec
u=0.01 s=0.00 cu=0.03 cs=0.02 scripts=1 tests=194
如果您想查看测试脚本的原始输出,您可以运行 perl
,如下所示:
[.../perl/t]$ ./perl -I../lib op/array.t
1..194
ok 1
ok 2
ok 3
...
ok 192 - holes passed to sub do not lose their position (multideref, mg)
ok 193 - holes passed to sub do not lose their position (aelem)
ok 194 - holes passed to sub do not lose their position (aelem, mg)
以上信息及更多信息可在 perlhack 中找到。 .
This document explains how Perl development works. It includes details about the Perl 5 Porters email list, the Perl repository, the Perlbug bug tracker, patch guidelines, and commentary on Perl development philosophy.
请注意,在上述命令生效之前,您需要运行 make test_prep
。 (如果您已经运行了 make test
,那么您实际上已经运行了 make test_prep
。)
关于perl - 构建 Perl 时如何测试单个失败的测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60344258/