> Ciao Loic ... I am now trying the net stuff with my htcheck. I hope that
> the changes you recently made on string memory allocation and deallocation
> could resolve the problem. I think we also should manage the signals in a
> better way (but I studied a bit last week how to do it -- If I am not wrong
> we should manage the SIGHUP signal).
>
> I don't really know how to write a test procedure ('what is the procedure
> for writing a test procedure?' <Sorry for the tonguetwister>). But later
> I'll check for it.
I'm cc'ing to the list. A test procedure is nothing but a program that
covers your code as completely as possible. When you write your code, what
do you do to check that it works ? I guess you try to run htdig to crawl
a web site. That's simple. How do you make sure that the rare cases are
working ? Scratch your head and try to find a web site that timesout, then
patch the htdig.conf to crawl it, then crawl it. And each time you want to
test this you have to go thru the same process.
The test directory is here to make all this a *lot* simpler. It already
has everything to start an HTTPD server. It contains it's own httpd
configuration (in the conf directory).
Create a directory in htdocs (htdocs/htnet) and place various cgi-bin that
simulate error conditions, timeouts, very slow connection.
Write a htdig.conf in the conf directory. Name it htdig.conf.net for instance.
And tell it to crawl this directory only.
Write a shell script named t_htnet and put inside it
test_functions # make sure the httpd server is running
$htdig -i -c $testdir/conf/htdig.conf.net
testnet
And of course, write testnet, a C++ program that access the htdig data
and make sure the result of the crawl is what you expected. Of course you
may do it in very different ways, there's always more than one way to do
it.
The most important thing to realize about tests is that even the
smallest test is usefull (just check t_htdig and you'll see that it's
not testing anything else but the fact that htdig does not dump core :-).
I would go as far as to say that unless you write these tests you'll
continously be very worried when you change two or three lines of code
because you'll never have enough time to test all the cases manually.
Write automated tests once, use them for ever :-)
--
Loic Dachary
ECILA
100 av. du Gal Leclerc
93500 Pantin - France
Tel: 33 1 56 96 09 80, Fax: 33 1 56 96 09 61
e-mail: [EMAIL PROTECTED] URL: http://www.senga.org/
------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the SUBJECT of the message.