On Tue, May 12, 2009 at 8:37 AM, Gabor Szabo <[email protected]> wrote:
> AFAIK the current testing framework assumes that you have the
> testing infrastructure installed in the same perl as the one you are testing.
>
> Would it be possible to allow testing an arbitrary perl executable ?
>
> The main use-case I have in my mind is to be able to test the behavior
> on really pure vendor supplied version of perl without the
> installation of the whole testing stack.

The "current testing infrastructure" isn't really a single thing.
You've got several steps in the process:

(1) Collecting the list of things to test
(2) Making all prerequisites available (really just a recursive process)
(3) Running each of configure/build/test and capturing output & exit status
(4) Gathering information on the environment and installed/available
modules (prererequisites and also toolchain)
(5) Using #3 and #4 to assign a grade
(6) Transmitting the report

What you're talking about is doing #3 and #4 with an arbitrary perl.
Theoretically, you could do that today, but in practice you can't
because those steps aren't cleanly divided across the components.  As
an approximation (and lumping various CPANPLUS::Dist::* in with
CPANPLUS):

(1) CPAN::YACSmoke, various PoCo, CPAN::Reporter::Smoker
(2) CPAN, CPANPLUS
(3) CPAN+CPAN::Reporter, CPANPLUS
(4) CPAN+CPAN::Reporter, CPANPLUS+CPAN::YACSmoke
(5) CPAN::Reporter, CPANPLUS
(6) Test::Reporter

My plan for CPAN::Testers::Client is to just do #5 and #6.  Then there
will be adapters that sit between CPAN and CPANPLUS and C::T::C for
#4.  Then the stack should look like this:

(1) CPAN::YACSmoke, various PoCo, CPAN::Reporter::Smoker
(2) CPAN, CPANPLUS
(3) CPAN+??????, CPANPLUS
(4) CPAN+C::T::C::CPAN, CPANPLUS+C::T::C::CPANPLUS
(5) CPAN::Testers::Client
(6) CPAN::Testers::Client

At that point, if you really want to have an external perl tested,
then one option is to  have a tool that does #2, #3 and #4 and hands
results to C::T::C.  The other possibility I could imagine would be to
write the adapters (C::T::C::CPAN/CPANPLUS) in a way that saves or
hands off what would normally go to C::T::C to something external.
That could be just files that are saved/loaded, or it could be some
sort of IPC/network service.  (Probably not hard to squirt the data to
a socket with a core module like Net::Cmd).

That suggests that the C::T::C adapters need to be
pluggable/configurable somehow.  I would probably do that *within* the
adapters (via some external configuration) rather than have the
adapters pluggable within CPAN/CPANPLUS (since that needs to be
tightly coupled and should only be done once).

How does that sound?

-- David

Reply via email to