NAME

App::Prove::Plugin::TestArgs - A prove plugin to configure test aliases and arguments

SYNOPSIS

# t/config.yml
---
t/foo.t:
  - alias: "Foo once"
    args:  [foo, bar]
  - alias: "Foo twice"
  - alias: "Foo thrice"
    args:  [baz]

# command-line 
prove -PTestArgs=t/config.yml --verbose t/foo.t :: quux corge
Foo once ....
1..1
# ['foo','bar']
ok 1 - t/foo.t
ok
Foo twice ...
1..1
# ['quux','corge']
ok 1 - t/foo.t
ok
Foo thrice ..
1..1
# ['baz']
ok 1 - t/foo.t
ok
All tests successful.
Files=3, Tests=3,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.07 cusr  0.02 csys =  0.12 CPU)
Result: PASS

DESCRIPTION

TAP::Harness is the default test harness of the prove command-line test driver program. The harness has a test_args object attribute that allows us to pass different arguments to test scripts. Furthermore the harness runtests() object method implementation allows us to run a test script multiple times giving each run a unique name (an alias). Unfortunately it seems to be impossible to control this functionality directly via the prove command-line interface.

This plugin allows you to assign multiple alias-args pairs to a test script. Each pair triggers a separate run of the test script. The args part of a pair is optional. If it is missing, prove's own optional test script arguments passed at the command-line after an arisdottle (::) are used as a default.

For the time being the configuration has to be stored in a YAML file that is the only argument passed to this plugin.

AUTHORS

Sven Willenbuecher, <sven.willenbuecher@gmx.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2024 by Sven Willenbuecher.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.