http://www.perlmonks.org?node_id=995464


in reply to Re^2: Test::More command-line arguments?
in thread Test::More command-line arguments?

Okay, I see part of my error. If I run the script directly through the interpreter, I get results:
$ perl t.t one two three 1..1 $ARGV = [ 'one', 'two', 'three' ]; ok 1 - placeholder $
...but is there a way I can pass command-line arguments if I use prove instead? I would like to have the statistics prove provides if possible.

Replies are listed 'Best First'.
Re^4: Test::More command-line arguments?
by sbohning (Initiate) on Oct 14, 2021 at 21:39 UTC

    from prove - Run tests through a TAP harness

    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.