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 Geoffrey Young <ge...@modperlcookbook.org> on 2004/09/15 20:48:17 UTC

run_tests and test_clean

hi all...

in TestMM.pm we have this:

  test_clean :
    ...


  run_tests : test_clean
    ...


test :: pure_all run_tests test_clean


in a test suite with *lots* of files, test_clean takes forever.  however, I
experience has shown me that test_clean is only really required when you
make changes to a configuration file or have autogenerated files you want to
regenerate, making it a waste common development circumstances where a
single test file is run over and over again.

I'd like to suggest that test_clean _not_ be a prerequisite for run_tests,
but instead shuffle the 'test' target around a bit.  with the attached
patch, you can save *lots* of cycles by doing something similar to the
following:

$ make test TEST_FILES=t/foo.t
$ make run_tests TEST_FILES=t/foo.t
$ make run_tests TEST_FILES=t/foo.t
...

in my current situation, the first (with t/TEST -clean) runs in 45 seconds,
while the second (and subsequent) iteration runs in 29 seconds.  definitely
a plus for me :)

--Geoff

Re: run_tests and test_clean

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>>Are you sure that there will be no side effects? 
> 
> 
> I'm pretty sure.  it's not like test_clean won't be called under normal
> 'make test' circumstances, it's just that now there would be a way around it
> if the user thinks it is beneficial.

Oh, now I remember where it was used. In the httpd-dev test suite: 'make 
test' was always nuking .so files and ssl stuff, which was a pain in an 
arse. But I don't know why Doug programmed it this way. It wasn't us who 
introduced that change.

>>If yes, then +1
> 
> 
> ok, cool.  if things blow up then I'll revert it, but I'm not seeing any
> problems on my end.

sure

>>Why not just run t/TEST directly instead of using make? I never use make
>>when developing tests. So it was never an issue for me.
> 
> 
> t/TEST works fine for smallish things, but make is nice for automatically
> computing and including library directories spread out all over the place.

+1

-- 
__________________________________________________________________
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

Re: run_tests and test_clean

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> Are you sure that there will be no side effects? 

I'm pretty sure.  it's not like test_clean won't be called under normal
'make test' circumstances, it's just that now there would be a way around it
if the user thinks it is beneficial.

> If yes, then +1

ok, cool.  if things blow up then I'll revert it, but I'm not seeing any
problems on my end.

> 
> Why not just run t/TEST directly instead of using make? I never use make
> when developing tests. So it was never an issue for me.

t/TEST works fine for smallish things, but make is nice for automatically
computing and including library directories spread out all over the place.

--Geoff

Re: run_tests and test_clean

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> hi all...
> 
> in TestMM.pm we have this:
> 
>   test_clean :
>     ...
> 
> 
>   run_tests : test_clean
>     ...
> 
> 
> test :: pure_all run_tests test_clean
> 
> 
> in a test suite with *lots* of files, test_clean takes forever.  however, I
> experience has shown me that test_clean is only really required when you
> make changes to a configuration file or have autogenerated files you want to
> regenerate, making it a waste common development circumstances where a
> single test file is run over and over again.
> 
> I'd like to suggest that test_clean _not_ be a prerequisite for run_tests,
> but instead shuffle the 'test' target around a bit.  with the attached
> patch, you can save *lots* of cycles by doing something similar to the
> following:
> 
> $ make test TEST_FILES=t/foo.t
> $ make run_tests TEST_FILES=t/foo.t
> $ make run_tests TEST_FILES=t/foo.t
> ...
> 
> in my current situation, the first (with t/TEST -clean) runs in 45 seconds,
> while the second (and subsequent) iteration runs in 29 seconds.  definitely
> a plus for me :)

Are you sure that there will be no side effects? If yes, then +1

Why not just run t/TEST directly instead of using make? I never use make 
when developing tests. So it was never an issue for me.


-- 
__________________________________________________________________
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