Compartir a través de


CETK Series: How to Analyze CETK Test Results to Debug a Driver

When you use the Windows CE Test Kit (CETK) to run tests on a Microsoft® Windows® CE–based device, you might want to analyze an unexpected result to determine the cause of the result. You begin your analysis by verifying that the OS design and hardware platform adequately support the CETK test. You might then need to debug the source code for the CETK test to find the reason for the unexpected result. By debugging the source code for the CETK test, you narrow the cause of the unexpected result to the line of code that exhibits unexpected behavior. You can use that information to debug your driver.

Investigation of a single test case result might yield insight into multiple test case results. A single condition might cause several related test cases to fail. For information about the test cases for each CETK test, see CETK Tests.

Information that a CETK test writes to the log can be a valuable source of information about a test. Careful inspection of the log might preempt the need for further investigation. For information about viewing a CETK test log, see Viewing the Results of a Test.

Hardware and Software Assumptions

  • You have connected the CETK to a target device.

    For information, see Connecting the CETK to a Target Device by Using Platform Manager.

  • You are familiar with running CETK tests on a target device.

    To learn how to run a CETK test, see How to Use the CETK to Test a Driver.

  • You have installed Windows CE Shared Source. For more information, see Installing Windows CE with Shared Source Code.

  • You have source code for the CETK test that returned a result that you want to analyze.

    Microsoft provides source code for some CETK tests to assist you in debugging your device drivers and to assist you in creating custom tests for the CETK. You cannot build some of the source files, and source files for certain tests are not provided.

To track your progress in the following table, select the check box next to each step.

  Step Topic

1. Familiarize yourself with the test result codes for a CETK test case.

 

Test Result Codes for a CETK Test Case
2. If a test case skipped, aborted, or failed, verify that the OS design and hardware platform adequately support the CETK test.

Investigating a Skipped CETK Test Case

 

 

Investigating a Failed or Aborted CETK Test Case

3. Display a list of test cases for the CETK test by editing the command line for the test.

Inspect the log, and note the ordinal and name of the test case that previously aborted, failed, or skipped.

Displaying a List of Test Cases for a CETK Test
4. Edit the command line for the CETK test to run only the test case that returned the result that you want to analyze. Running a Single Test Case From a CETK Test
5. Determine the value of the %_PRIVATEROOT% environment variable.

In this procedure, for <variable name>, type _privateroot.

Determining the Value of an Environment Variable
6. Find sources files related to the CETK test.

A sources file is a text file that sets the macro definitions for the source code in a directory. Platform Builder uses sources and dirs files to build projects.

Finding Files for a CETK Test
7. In each directory that contains a sources file that specifies as TARGETNAME the name of the Tux DLL for the CETK test, search for the test case name in the source code.

Search until you find an occurrence of the test case name within the definition of a FUNCTION_TABLE_ENTRY structure. Note the function name associated with the test case name.

Finding a Test Case in the Source Code for a CETK Test
8. In each directory that contains a sources file that specifies as TARGETNAME the name of the Tux DLL for the CETK test, search for the function name associated with the test case.

Open the file that contains each search result until you find the implementation of the function.

Finding the Function for a Test Case in the Source Code for a CETK Test
9. In the implementation of the function that corresponds to the test case, set a breakpoint at the entry point and at each exit point. Setting a Breakpoint at a Source Code Line
10. Edit the command-line for the CETK test to run only the test case that returned the result that you want to analyze.

Confirm that the breakpoint at the function entry point activates, and then confirm that a breakpoint at an exit point activates.

If a breakpoint at an exit point does not activate, an exception might have occurred. Use stepping, breakpoints, and other debugger functionality to narrow the cause to the line of code that exhibits unexpected behavior. For information about debugger functionality, see System Debugging.

Running a Single Test Case From a CETK Test

See Also

How-to Topics | Windows CE Test Kit | CETK Setup | System Debugging

 

Don Gambrell