You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2003/07/10 06:06:19 UTC
Re: Perl Testing
David Wheeler wrote:
> On Thursday, June 19, 2003, at 09:13 AM, Geoffrey Young wrote:
>
>> I think he means by adding your own ServerRoot directive to
>> extra.last.conf.in. however, I see what you are saying and that won't
>> likely resolve your issue.
>
>
> Yes, and I can't know what it is ahead of time. I don't expect that this
> would work:
>
> ServerRoot @ServerRoot@/..
either at run-time:
t/TEST -serverroot /my/server/root
or in your t/TEST script:
$Apache::TestConfig::Argv{serverroot} = "/my/server/root";
or in your Makefile.PL:
push @ARGV, qw(-serverroot /my/server/root);
Apache::TestMM::filter_args();
Apache::TestMM::generate_script(t/TEST);
I haven't tested that, but it should work just like all other overrides, no?
t/TEST --help shows all the available options
>> is there some reason that you want to backtrack to t/ in your test
>> scripts? for the most part, I put things I need under t/, including
>> libraries and other cruft, so that everything is relative to the
>> default ServerRoot setting.
>
>
> I _do_ want t to be the ServerRoot. But I _don't_ want t/ to be cwd for
> all of the tests that run (t/*.t). cwd during `make test` should be the
> package root directory. For example, I have a test script, t/01basic.t,
> that opens the error log to look for error messages from the Apache test
> server. Under Apache::test (and any other CPAN test suite that runs via
> Perl's usual `make test`), I would have to open it like this:
>
> open ERR, 't/logs/error_log' or die "Can't do it: $!\n";
>
> However, under the default `make test` with Apache::Test, it changes the
> cwd to t. This is not where CPAN modules should be tested from. It
> forces me to open the error log like this, instead:
>
> open ERR, 'logs/error_log' or die "Can't do it: $!\n";
>
> That's what I think should be changed.
>
> Hope I've explained it better this time! :-)
don't rely on cwd, use the full path:
my $vars = Apache::Test::vars();
my $path = catfile $vars->{serverroot}, qw(logs error_log);
Does that solve your problem?
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com