Perl-Sensitive Sunglasses | |
PerlMonks |
Testing a Client-Server Applicationby dreadpiratepeter (Priest) |
on May 05, 2004 at 16:05 UTC ( [id://350829]=perlquestion: print w/replies, xml ) | Need Help?? |
dreadpiratepeter has asked for the wisdom of the Perl Monks concerning the following question:
I'm at a loss as to how to set up rigorous Test::More testing for an app I'm writing. The application consists of a server that runs a game played by multiple clients. There are always at least two clients involved and they alternately are waiting or acting based on messages from the server.
The issue is that I want to provide rigorous testing. In a perfect world I could just spawn a server, spawn the clients and run a scripted game, invoking tests as I go. However I know that running tests from a child doesn't work. I looked at Test::MultiFork, but frankly the documentation is sparse and what there is makes my brain hurt. I have a current inkling of a solution. I'm using Log::Log4Perl, I could setup a special logger that spits out state information, and have my test suite spawn the server and two scripted clients, let them interact in the background, and read the log output, running tests on expected vs actual behavior. i.e. and so on. Then my test script can open a tail on the output and run tests like:
Anyone have any comments or better ideas for how to test this beast? -pete "Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere." Edit by tye, change unclosed PRE tags to CODE
Back to
Seekers of Perl Wisdom
|
|