3

How can you change the default tests path in Makefile.PL from the default value t/*.t? There's an attribute mentioned in the documentation but it does not work. Anybody know how to that?

brian d foy
  • 129,424
  • 31
  • 207
  • 592
marghi
  • 233
  • 1
  • 9

2 Answers2

2

In Makefile.PL:

WriteMakefile(
    test => { TESTS => 'tests/*.t'},
    ....

Will make make test run the tests scripts in tests instead of t.

innaM
  • 47,505
  • 4
  • 67
  • 87
  • This seems to work with the latest Makemaker, but it was broken for a while. That breakage led me to write Test::Manifest. – brian d foy Mar 12 '09 at 19:16
  • I thought that was because of the automatic sorting. – Schwern Mar 15 '09 at 23:23
  • I actually saw it in the documentation. But I didn't try it, I was a little confuse about it ( capital attributes and lowercase attributes). It's a bit confusing. – marghi Mar 20 '09 at 14:25
  • It is! Just don't think too much about it and give it a try. – innaM Mar 20 '09 at 15:10
  • @Schwern: a long time ago I used TESTS to set the order I wanted. You were working on something that broke that, I asked you about it, and you said "Don't do that". So I came up with another way. :) – brian d foy Jan 25 '10 at 17:29
1

Manni's suggestion allows you to have the glob pattern that MakeMaker will use in the test targets, but that's still rather limited. I wrote Test::Manifest so that I could override those portions to do exactly what I needed to do. Even if you don't want to do the same thing that Test::Manifest does, you can look at the source to see what I did.

brian d foy
  • 129,424
  • 31
  • 207
  • 592