Automatic Addition of Test Functions to the Test List

Automatically Adding Tests during Device Categorisation

When a device is categorised, the test functions from its test device file can often be added to the test list automatically.

If any function in the test device file is declared using the @testfunction flag, only the functions in the file marked in that way will be available for adding automatically (other suitable functions can be added manually). If no functions in the file are declared with that tag, those that meet the criteria for being usable will be available for adding automatically.

When a component is categorised as a Test device, the dialog box shown below in Figure 2 will be displayed. The functions from the file that can be added to the test list automatically are itemised in the Add Tests section on the right (when the device type has been selected in the top part of the dialog box).

Leave ticked for test to be added automatically "Y" indicates the test will run by default Select the group to insert the test into from the dropdown menu

Figure 2: Automatically Adding a Test to the List During Categorisation

By default, the test will have been set to run, although this may have been changed via the function's XJEaseDoc tags (see Figure 3 below). The value for this setting is shown in the dialog, together with the name of the test group to which it will be added.

Test Groups

The default test group to which the function will be assigned is determined by several factors:

  • If the test function includes the XJEaseDoc tag that specifies a particular test group (@groupname), the function will be placed in that group (see Figure 3 below).
  • If the test device file is taken from a library but the function does not include the @groupname tag, its test function(s) will be placed in a group that is given the same name as the group in the library.
  • If the test device file does not come from the library, the function will be placed in an Auto-added Tests group unless the @groupname tag has been used.

To change the selected test group, either use the menu to choose a different one or type a new name directly into the box. Note that it is not possible to change whether the test runs by default from this dialog (that can be changed later in Setting Which Tests Run and the Order of Execution).

To add the test to the selected group in the test list, keep the tick in the checkbox and click OK to categorise the test device.

Figure 3 below shows an example of an XJEaseDoc entry in the heading of a test device file. The @testfunction tag's optional argument defaultenabled or defaultdisabled determines whether the test will run or not by default.

The optional @groupname tag defines the test group into which it should be placed.

/// Checks connectivity of address, data and control signals
///
/// @param result Returns RESULT_PASS on success
///
/// @testfunction defaultenabled @groupname SRAM Tests
///
GLOBAL Test()(INT result)
  PRINT_FORMAT(TITLE_STYLE, "Testing SRAM ");
  PRINT_DEVICE_LINK(UNIQUE_DEVICE_REF);
  PRINT_FORMAT(TITLE_STYLE, "...\n");

  MemTest()(result);
  IF result != RESULT_PASS THEN RETURN; END;

  IF WRITEABLE(nOE) THEN
    TestnOE()(result);
    IF result != RESULT_PASS THEN RETURN; END;
  END;
END;

  

Figure 3: Using XJEaseDoc tags above a Test Function