6

I try to run test under debugger as:

perl -d $(which prove) t/file.t

But this has no effect because each test is run as separate job.

I have found --exec option, but when I provide it I lost any option from .proverc file and command line

prove -Ithis/is/lost --exec 'perl -d' t/file.t

How to run tests by prove with additional options and do not lose those options which were provided at .proverc file and command line?

I do not want repeat myself and write:

prove --exec 'perl -d -Ilib -Ilocal/lib/perl5' t/file.t

While -Ilib and -Ilocal/lib/perl5 are both at .proverc file

Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158

1 Answers1

1

You can repeat yourself once if you set the PERL5OPT environment variable.

export DBG_MODE='-d -Ilib -Ilocal/lib/perl5'
prove t/file1.t                       # regular use
PERL5OPT=$DBG_MODE prove t/file2.t    # with debugger

or with an alias or bash function

alias proved='PERL5OPT="-d -Ilib -Ilocal/lib/perl5" prove'
mob
  • 117,087
  • 18
  • 149
  • 283
  • I have tried it too. It did not work, because it will run two debuggers. One for prove and second for test. I setup port to debug remotely, but because of two debuggers are run I got conflict about that port is in use and scenario dies ( – Eugen Konkov Mar 15 '17 at 20:05