perl - 构建 Perl 时如何测试单个失败的测试

标签 perl testing

当尝试运行 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/

相关文章:

perl - 如何仅从 Perl 程序的主包获取跟踪输出

unit-testing - 在哪里保存单元测试数据?

java - 从 Maven 中的测试资源复制空目录

javascript - 使用 Javascript 请求阻止?

perl - 如何从一个 perl 模块调用子程序到另一个 perl 模块?

regex - Perl regex\d+ 和 [0-9] 运算符仅显示字母数字字符串中的单个数字

perl - 如何将 C NULL 传递给基于 XS 的函数?

perl - 为什么 "import"子程序在 Perl 中没有大写

Java Gridgain 应用程序在压力测试 1 天后开始失败

ruby-on-rails - 如何使用 rspec 在 Controller 中测试自定义路由