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:

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.