Listing Functions and Test Units

From STRIDE Wiki
Revision as of 10:07, 28 August 2009 by Timd (talk | contribs)
Jump to: navigation, search

Overview

While the STRIDE runner is mainly used to execute tests, it can also be used to list the test units that are available in a target build. The listing capability is useful in several scenarios:

  • Verifying that a particular test unit is available in a specific build
  • Creating a command file that will be used to run only tests who's names match a specific text pattern
  • Creating a command file that will be used to run all tests in a particular order

To list the available test units, run stride giving it command line parameters as follows:

stride --list --database TestApp.sidb

List Output

Test units are listed in the order they are encountered in the .sidb file (which reflects the order they were seen by the stride compiler when the target was built).

Each member test unit in the .sidb file is listed, with one test unit per line. A sample of this output from the TestIntro build is shown below.

s2_testintro_cclass
s2_testintro_flist
s2_testintro_testdoubles
s2_testintro_testpoints

Advanced List Usage

The list output can be piped to another program such as grep in order to create a list of test units filtered by name characteristics.

For instance, suppose that you want to run only the test units owned by your department or development group from a target build that includes many tests aggregated from others. Provided that your test units follow a unique naming convention, you can create a filtered list as follows:

stride --list --database TestApp.sidb | grep myPrefix_*

Further, by redirecting the output to a file, you can create a stride command file with a little editing.

A technique using stride's list capability to automate the running of a subset of tests is shown here.

For full details on stride command line parameters, please see STRIDE Runner.