David Wheeler wrote:
On Jun 22, 2004, at 10:33 AM, Stas Bekman wrote:

Absolutely. It's really just:

MyTest->new->run(@ARGV);

where MyTest is a subclass of Apache::TestRunPerl


I tried that, but it didn't work. I'm not sure why. The first problem was this code:

    $0 = File::Spec->rel2abs($0);
    if (-e $0) {
        my $top = dirname dirname $0;
        chdir $top if $top and -d $top;
    }

Which moved things out of the module root, since Build.PL isn't in t/. I got 'round that by doing C<local $0 = ''>, but then nothing else happened. Odd.

ah, yes, it tries to figure out where it is and move out of t/, as per your request earlier. Feel free to suggest a way to work it out. That particular code could be made into a subclassable method, which your subclass could implement differently.


Though you will need to figure out how to pass the options, which is already not trivial at all, since there are quite a few ways to feed them in at different phases.


Yes, that's the other thing I wanted to avoid.

How are you going to avoid that? I mean your users need to be able to run certain features of Apache-Test, which are beyond 'make test'. May be you want to always create t/TEST, but run 'make test' without invoking t/TEST?


* I wasn't sure how the TEST_FILES environment variable was supposed to work. So I'm just passing it to the call to t/TEST if it exists. Stas, is this the correct thing to do?


I think yes, but why not keep it an env var?


It is an environment variable. If, however, you mean that t/TEST spots the environment variable and does the right thing, then cool, I'll simply take out out of TestMB.

Creo que si, i.e. yes :)

I believe it's autogenerated, I didn't write that code, so you can look just as well :) You can use libapreq-2's source from CPAN to see how c-modules work.


Pass. I don't really do C. I put in some stubs for it, though.

there is no C, there is perl that creates the necessary build environment.

I've skimmed the source, it looks good David, but please use indentation of 4 everywhere.


I did; only lines that continue from a previous line use two spaces. If you want four there (confusing, IMO), I can change it.

Yes please, we use 4 everywhere.

Also how the following code is supposed to work?

    my $infile = '$script.PL';
    if (-f $infile) {


It will use t/TEST.PL to generate t/TEST if t/TEST.PL exists. Otherwise, it generates t/TEST like TestConfig::generate_script(). does.

I meant the fact that '$script.PL' doesn't interpolate $script.

Also you can use shortcuts from Apache::TestTrace to do logging.


Um, I have no idea what you're talking about here. Sorry.

use Apache::TestTrace;

debug "foo";

error "bar";

etc...

The tracelevel will automatically enable and disable various trace levels. See Apache::TestTrace for more info.

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to