httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject Re: [RFC] running tests after the server stops
Date Tue, 23 Sep 2003 14:23:44 GMT
ok, here we go :)

I have a preliminary implementation.  what happens now is that two files are 
autogenerated if they don't already exist:

t/server-start.t
t/server-stop.t

they are used to control the starting and stopping of the server.  so, the 
output of make test looks like

# writing file: server-start.t
# writing file: server-stop.t
pre-start/ping....ok
server-start......*** server localhost.localdomain:8529 started
server-start......ok
ping..............ok
request...........ok
server-stop.......*** server localhost.localdomain:8529 shutdown
server-stop.......ok
post-stop/ping....ok
All tests successful.
Files=6, Tests=20,  3 wallclock secs ( 2.03 cusr +  0.16 csys =  2.19 CPU)
# removing file: server-start.t
# removing file: server-stop.t


another condition of server-control file autogeneration is that there be 
real server tests to run.  this makes it trivial to run pre-start or 
post-stop tests by themselves:

$ t/TEST t/pre-start/
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST 't/pre-start/'
pre-start/ping....ok
All tests successful.
Files=1, Tests=3,  1 wallclock secs ( 0.28 cusr +  0.03 csys =  0.31 CPU)


anyway, so that's how it looks on the outside.  on the inside is another 
matter...

as I mentioned, I'm really not too sure about mucking with the core engine 
like this (although I did take some comfort in the fact that not only did 
the changes work for all of my personal A-T modules, but I didn't need any 
tweaks to get the mod_perl 2.0 suite running successfully).  I might prefer 
to create a subclass of TestRun and TestHarness that works this way and 
leave it up to people to choose which they use from TEST.PL - it depends on 
how much the people here like the implementation (after any suggested 
refinements and refactoring are applied, of course :)

so, give it a whirl and let me know what you think.

--Geoff


Mime
View raw message