LoginSignup
4
4

More than 5 years have passed since last update.

.tブランチ作ったらproveがおかしくなった

Last updated at Posted at 2014-04-14

proveでテストを実行する適当なPerlプロジェクトがあるとします.

$ prove -lr
t/lib/Hoge.t .. ok
All tests successful.
Files=1, Tests=1,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.02 cusr  0.01 csys =  0.07 CPU)
Result: PASS

ここに.tで終わるブランチなんかを作ってしまい‥

$ git checkout -b fugafuga.t
Switched to a new branch 'fugafuga.t'
$ prove -lr
./.git/logs/refs/heads/fugafuga.t .. Number found where operator expected at ./.git/logs/refs/heads/fugafuga.t line 1, near 

(途中略)

Execution of ./.git/refs/heads/fugafuga.t aborted due to compilation errors.
./.git/refs/heads/fugafuga.t ....... Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
./t/lib/Hoge.t ..................... ok

Test Summary Report
-------------------
./.git/logs/refs/heads/fugafuga.t (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
./.git/refs/heads/fugafuga.t     (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
Files=3, Tests=1,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.02 cusr  0.01 csys =  0.07 CPU)
Result: FAIL

ギャース!
proveさんが.git/logs/refs/heads/fugafuga.tをテストだと勘違いしてしまいテストが失敗する羽目に.
.gitなんて勝手に除外してくれてるものだと思い込んでいたのでかなり面食らってしまった.

$ prove -lr t/
t/lib/Hoge.t .. ok
All tests successful.
Files=1, Tests=1,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.02 cusr  0.01 csys =  0.07 CPU)
Result: PASS

ちゃんとDirectory指定してあげればいいんだけどめんどい.

4
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4