eCosTM User’s Guide
Prev | Chapter 3. Basic Operations | Next

# Executing Tests

Select Tools -> Run Tests to execute tests built using the Configuration Tool. If the dialog is dismissed using the OK button, the selected tests will be scheduled for execution. To stop the execution of tests before completion, select Build -> Stop, or click the corresponding toolbar icon.

Depending on the configuration selected, it may be possible to execute tests in a simulator process or using hardware attached to a serial port.

The following controls are used to determine how the tests are run:

- Execute in simulator

  Check this box if the tests are to be run in a simulator process. If this box is grayed, the configuration chosen is not suitable for both simulator and hardware test execution.

- Serial Device

  When executing on hardware, use this combo box to select the serial port to which the target board is connected.

- Baud Rate

  When executing on hardware, use this combo box to select the baud rate to be used for download.

- Active Timeout

  Set this box to a figure representing a timeout (in seconds) to be applied to the execution of each test; leave the timeout value at zero to allow the Configuration Tool to choose a suitable default timeout value.

  If the test executes for longer than the specified time (in the case of simulator runs, the time measured is CPU time; for hardware runs it is elapsed time) without outputting a line starting with one of the following:

  INFO:
  PASS:
  FAIL:
  EXIT:

  then the test will be terminated with status “Timeout”.

The listbox within the dialog allows you to select which tests are to be run. Click “Check All” to select all build tests for execution, or “Uncheck All” to deselect all tests. Clicking the Refresh button causes the Configuration Tool to rebuild its list of tests by re-examining the build tree to determine those test executables that have been successfully linked.

eCos tests use a set of primitives (currently implemented as macros) to allow for easy analysis of their output. When tests are run using host-side infrastructure (e.g. from the Configuration Tool) the correct use of these primitives is important, to allow test execution to be automated. In future releases, host-side test infrastructure may form part of the eCos deliverable.

The result will be one of the following:

NORESULT, INAPPLICABLE, PASS, FAIL

When a test starts executing, its result is NORESULT. Test code should ensure that it is set to one of the other results by executing one of the following test primitives:

`void CYG_TEST_INIT`(void);

Must be called before any other test primitive.

`void CYG_TEST_INFO(s)`(void);

The informational string s is output. This does not affect the result of a test.

`void CYG_TEST_NA(s)`(void);

The result of the test is set to INAPPLICABLE and the informational string s is output. Note that the result of a test may subsequently be set to PASS or FAIL by means of `CYG_TEST_PASS` or `CYG_TEST_FAIL`.

`void CYG_TEST_PASS(s)`(void);

The result of the test is set to PASS and the informational string s is output. Note that the result of a test may subsequently be set to FAIL by means of `CYG_TEST_FAIL`.

`void CYG_TEST_FAIL(s)`(void);

The result of the test is set to FAIL and the informational string s is output. Having used `CYG_TEST_FAIL`, the result of the test cannot be changed.

`void CYG_TEST_EXIT(s)`(void);

Must be called after all other test primitives. The informational string s is output and the test is terminated.

Prev | Home | Next
Building | Up | Keyboard Accelerators