6

Currently I run prove like this:

prove -v -r .

Is there a way to exclude files using regex? I could not see that in perldoc prove or the output of prove -H.

Andy Lester
  • 91,102
  • 13
  • 100
  • 152
kamal
  • 9,637
  • 30
  • 101
  • 168
  • There's not, but I swear I saw an article a few weeks ago, maybe on http://blogs.perl.org, where someone had worked on making this possible. I'm looking in my @perlbuzz Twitter archives and not seeing it there. Sorry. – Andy Lester Dec 12 '12 at 16:01

2 Answers2

4

I usually do something like this:

$ find t/ -name '*.t' ! -name '*timeout*' | xargs prove -l

(skips slow timeout tests)

ikegami
  • 367,544
  • 15
  • 269
  • 518
creaktive
  • 5,193
  • 2
  • 18
  • 32
2

I managed to do this by using a sub-directory :

$ tree t/
t/
├── 01_tests.t
├── 02_tests.t
├── 03_tests.t
└── ignored
    └── 01_ignored.t

Then I do this to execute the normal tests:

$ prove -v t/*.t
t/01_tests.t ........ ok
t/02_tests.t ........ ok
t/03_tests.t ........ ok
Result: PASS

And this to execute the ignored tests in another context:

$ prove -v t/ignored/
t/ignored/01_ignored.t ........ ok
Result: PASS

Simple and efficient solution if your tests are not already stored in different sub-directories.

For making it easier to use, and document how to run the tests, I usually put those in a Makefile.

smonff
  • 3,399
  • 3
  • 36
  • 46