Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options with parameters not always correctly passed to prove #19

Open
mmitch opened this issue Apr 10, 2017 · 1 comment
Open

options with parameters not always correctly passed to prove #19

mmitch opened this issue Apr 10, 2017 · 1 comment

Comments

@mmitch
Copy link

mmitch commented Apr 10, 2017

I want to pass the -I lib/ parameter to prove to make it look in another base directory for my files.

When I run autoprove -I lib/, the initial test run is OK and the parameter is passed to prove like this:

prove --norc -v -m -I lib/ ::
ALL PASSED
t/01.instance.t:
# Subtest: instance
# Subtest: inheritance

When I then change a file, autoprove picks up the change and runs prove again, but this time the lib/ is missing from the -I parameter and gets replaced by the test to run, which completely breaks my tests:

prove --norc -v -m -I t/01.instance.t ::
3 planned, only 0 passed.
Failed test(s) in t/00.load.t: 1
 Non-zero exit status: t/00.load.t
Failed test(s) in t/01.instance.t: 1 2
 Non-zero exit status: t/01.instance.t
t/01.instance.t:
Can't locate object method "new" via package "Log::Dispatch::Desktop::Notify" (perhaps you forgot to load "Log::Dispatch::Desktop::Notify"?) at t/01.instance.t line 7.t/01.instance.t:
#   Failed test 'use Log::Dispatch::Desktop::Notify;'
#   at t/01.instance.t line 4.
#     Tried to use 'Log::Dispatch::Desktop::Notify'.
#     Error:  Can't locate Log/Dispatch/Desktop/Notify.pm in @INC (you may need to install the Log::Dispatch::Desktop::Notify module) (@INC contains: /home/mitch/git/log-dispatch-desktop-notify/t/01.instance.t /home/mitch/perl5/lib/perl5/x86_64-linux-gnu-thread-multi /home/mitch/perl5/lib/perl5 /home/mitch/perl5/lib/perl5/x86_64-linux-gnu-thread-multi /home/mitch/perl5/lib/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at t/01.instance.t line 4.
# BEGIN failed--compilation aborted at t/01.instance.t line 4.
# Subtest: instance
# No tests run!
#   Failed test 'No tests run for subtest "instance"'
#   at t/01.instance.t line 9.
# Looks like your test exited with 255 just after 2.

------------------------------------------------------------

It looks like Test::Continuous::_classify_opts() splits the parameters by type so that -I ends up in @not_files while lib/ ends up in @tests (because it is a directory).

Both -I and lib/ should instead end up in @not_files to be passed to prove without any changes.

@mmitch
Copy link
Author

mmitch commented Apr 10, 2017

…10 seconds after opening this issue I reread the prove manpage and found out that -I lib can be shortened to a single -l parameter which also works with autoprove.
So I have a workaround for my current problem.

But the basic problem remains: Any prove option with an argument that looks like a file or directory will break. -I and -e could both be problematic.

@mmitch mmitch changed the title "-I lib/" parameter not correctly passed to prove options with parameters not always correctly passed to prove Apr 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant