How can I run only a specific test in a Perl distribution?

前端 未结 2 1596
予麋鹿
予麋鹿 2021-02-19 03:26

This question is related to this question I asked before. I have multiple test files (A.t, B.t, C.t etc) created to test their respective module A, B, C & so on. But when I

2条回答
  •  余生分开走
    2021-02-19 03:52

    Executing tests directly through perl works. The prove command was designed to simplify the process, save keystrokes, and shorten the test-debug-test cycle.

    prove was designed to work on multiple tests at a time, which you can't do invoking via perl. For instance, you can do:

    prove t/*.t
    prove t/     # Same as t/*.t
    prove t/dev/ # Run only tests in t/dev/
    prove -r t/  # Runs all .t files in t/ and any directories below.
    

    The modern prove also has many features for handling suites of tests and modifying how the TAP output from the tests is displayed.

    prove --help will show you all prove's options, and prove --man will show you the manual page.

提交回复
热议问题