2

I'm trying to pass some parameters to a test script through the prove command. Based on some old threads where is option was hashed out, and the content's of my prove's man page (quoted below), using :: before the options should work, but prove is still parsing the test script's option as it's own:

$ prove -v t/040-unit-object-test.t :: --unit 270149 Unknown option: unit

Here the relevant part of the man page:

   Arguments to Tests

  It is possible to supply arguments to tests. To do so separate them
  from prove's own arguments with the arisdottle, '::'. For example

   prove -v t/mytest.t :: --url http://example.com

  would run t/mytest.t with the options '--url http://example.com'.  When
  running multiple tests they will each receive the same arguments.

I tried using sudo to run the option as root, but got the same error.

I am using the Getopt::Long module to get the options, and the options work when I run the test script using plain old perl, but then my SKIP and TODO blocks don't work.

I would rather not have to use the --exec workaround.

I'm running Perl 5.10 on Mac OS 10.6.

The output of prove -V is:

prove v2.64, using Test::Harness v3.25 and Perl v5.10.0

Van J. Wilson
  • 166
  • 1
  • 7

1 Answers1

3

Well, you must have two versions of prove in your $PATH, an old one from 2006 from before App::Prove existed

I suggest you delete that one, and re-install App::Prove

so not liopa
  • 485
  • 2
  • 5
  • You were right. I actually had 3 versions of `prove`. The latest one, from Nov. 2009, allowed passing of arguments through to test scripts. (Even stranger, when I type `man prove`, I get the man page from a 2012 version.) – Van J. Wilson Dec 04 '12 at 21:25
  • OK, when I run my newer copy of `prove`, it's using a different copy of `perl`, which doesn't have all the modules I need installed. Do I have to install all the modules again, for the newer copy of perl, can I "uninstall" the prove from the /usr/bin directory and update it without updating the whole Perl installation? – Van J. Wilson Dec 04 '12 at 21:50