[Cppunit-devel] GUI TestRunner w/ auto-register runs automatically
Brought to you by:
blep
|
From: Arlo B. <arl...@ho...> - 2001-12-08 00:46:01
|
I don't know whether anyone else has observed the same problem, so I don't know whether this is a problem with the framework, or with my use of it. Here's what I'm seeing: I have several tests for classes that operate on an event-based method, using separate threads. They expect the item using them to also perform message handling. Obviously, the thread that is running a test is not about to perform message handling (some 500 messages during a single test run). Thus, I create a utility class that operates with the test class. It contains its own thread & message loop, and performs the direct communication with the class being tested. The test case creates a script, and the assistant class runs the script and notifies the test case if it doesn't go exactly as scripted (right messages at right times, plus usual asserts). The test case waits for the assistant to end, then checks for assertions and exits. There may be more than one assistant - one of my tests is of a networking subsystem, so it sets up a series of virtual machines, each listening on a different port, then gives each a script indicating what messages it should sent to and expect from where. They all use the box's IP address, and actually route traffic across our LAN and back to the test. However, this has allowed me to see a problem. It appears that the MFC GUI test runner w/ auto-registered tests causes their fixture setup functions to be executed when the dialog first appears - before the user selects a test and runs it. In my case, that means that my process suddenly spawns fifty or more threads, even though no single test requires more than 6. We're just getting started on this project, and we're already facing resource starvation because of the tests! Has anyone else observed that the fixture setup functions get called early? Was it a problem with their use of the library, or is there a bug in CppUnit? Arlo |