Custom Module Creation for the Modular Stress Test
You can create a custom test module for the Modular Stress Test. In designing a test module, you should take advantage of the features of the harness and conform to established standards for the Modular Stress Test. The Modular Stress Test is only as effective as the test modules that it runs.
A test module for the Modular Stress Test should have the following qualities:
- Be duration-based. The test module should be designed to run for an arbitrary length of time and to terminate when time expires. Each test module should be an indivisible unit of testing that is intended to be run in several iterations in a loop.
- Record test passage or failure on a per iteration basis and report test results to the harness.
- Support the use of filtered logging through the use of logging functions in the StressUtils.dll module.
You can implement a stress module as a dynamic-link library (DLL) that is loaded by a generic Stressmod.exe container. Stressmod.exe manages command-line parsing, module duration, and results recoding and reporting for the test.
Your DLL must export an InitializeStressModule function, a DoStressIteration function, and a TerminateStressModule function. For more information about the functions that your DLL must export, see Custom Stress Module Functions.
In your test module, use the members of the MODULE_PARAMS structure to access information from the command line. For more information, see InitializeStressModule.
Design the test module to run for an arbitrary length of time. Separate your tests into iterations that the harness can run in a loop. At the end of the duration requested by the harness, the module should clean up, report results, and exit gracefully.
Most test modules require a minimum amount of time to perform a single iteration. Add information about the minimum duration of the test module to the initialization file for the harness so that the harness requests the module to run for at least the minimum amount of time required for a single iteration.
Under most circumstances you may not want detailed comments throughout the log for a test. At other times, for example when debugging or attempting to reproduce a problem, you want detailed information to appear in the log. You can control the verbosity level of the log. The harness and associated modules provide a set of logging functions that you can use to preemptively filter the log for verbosity. For more information, see Modular Stress Test Functions.
The test module must report whether the test passed or failed. The harness gathers information about test passage or failure on a per iteration basis. Every call to the DoStressIteration function exported by your module is considered iteration and the harness records the return value. For information about possible return values, see CESTRESS Return Value.
Before building the test module, create a dirs file in %_WINCEROOT%\Private\Test\Stress and enter the following lines in the dirs file:
DIRS=\
stress
After you create this dirs file, you can use the Windows CE Build Tool (Build.exe) to build the test module from the build window.
See Also
Design Considerations for Stress Module Creation | Modular Stress Test | Modular Stress Test Command-Line Options
Last updated on Friday, October 08, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.