Skip to content

Commit

Permalink
Fix nasa#1281, adjust event types and documentation
Browse files Browse the repository at this point in the history
Adjust the event types so that Start/End are "info" events, not debug
events (in the default platform config, debug events are not shown).

Also update documentation to correct the startup script entries.
  • Loading branch information
jphickey committed Apr 14, 2021
1 parent 422dcac commit ec2d2f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
24 changes: 11 additions & 13 deletions docs/README_functionaltest.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

This version of CFE includes additional modular libraries and an application
to execute functional tests within an unmodified CFE environment. These are
distinct from the unit tests, which are executed separately from CFE in a
distinct from the unit tests, which are executed separately from CFE in a
confined (non-CFE, test-specific) environment.

## Building the modules

These modules are built automatically when `ENABLE_UNIT_TESTS` is enabled
These modules are built automatically when `ENABLE_UNIT_TESTS` is enabled
in the build. However, they can be added to any CFE build by adding the
following to the `APPLIST` of any target in `targets.cmake`:

- `cfe_assert`: a CFE-compatible library wrapping the basic UT assert library. This
is the same library that all other unit tests use, but configured to be
is the same library that all other unit tests use, but configured to be
dynamically loaded into the CFE environment, and using CFE syslog for its output.
This must be the first library loaded for any functional test.

- `cfe_testcase`: a CFE-compatible library implementing test cases for CFE core apps.
This must be loaded after `cfe_assert`.
This must be loaded after `cfe_assert`.

- `cfe_testrunner`: a CFE application that actually executes the tests. This is a very
simple app that waits for CFE startup to complete, then executes all registered test
- `cfe_testrunner`: a CFE application that actually executes the tests. This is a very
simple app that waits for CFE startup to complete, then executes all registered test
cases. It also must be loaded after `cfe_assert`.


Expand All @@ -29,12 +29,10 @@ cases. It also must be loaded after `cfe_assert`.
To execute tests at startup, the following lines can be added to `cfe_es_startup.scr` on the
designated test target:

CFE_LIB, cfe_assert, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0;
CFE_APP, cfe_testrunner, CFE_TR_AppMain, TESTRUN_APP, 100, 16384, 0x0, 0;
CFE_LIB, cfe_testcase, CFE_Test_Init, CFETEST_LIB, 0, 0, 0x0, 0;
CFE_LIB, psp_test, PSP_Test_Init, PSPTEST_LIB, 0, 0, 0x0, 0;
CFE_LIB, cfe_assert, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0;
CFE_APP, cfe_testcase, CFE_TestMain, CFE_TEST_APP, 100, 16384, 0x0, 0;

It is important that `cfe_assert` is loaded first, as all other test libraries depend on
It is important that `cfe_assert` is loaded first, as all other test applications depend on
symbols provided in this library. The order of loading other test cases should not
matter with respect to symbol resolution, but note that test cases will be executed in
the same order that they are registered.
matter with respect to symbol resolution, but note that test apps may be executed in
a different order than they are listed in the startup script.
6 changes: 3 additions & 3 deletions modules/cfe_assert/src/cfe_assert_runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ void CFE_Assert_StatusReport(uint8 MessageType, const char *Prefix, const char *
case UTASSERT_CASETYPE_TTF:
EventType = CFE_EVS_EventType_ERROR;
break;
case UTASSERT_CASETYPE_BEGIN:
case UTASSERT_CASETYPE_END:
case UTASSERT_CASETYPE_INFO:
case UTASSERT_CASETYPE_MIR:
case UTASSERT_CASETYPE_NA:
EventType = CFE_EVS_EventType_INFORMATION;
break;
case UTASSERT_CASETYPE_BEGIN:
case UTASSERT_CASETYPE_END:
case UTASSERT_CASETYPE_NA:
case UTASSERT_CASETYPE_PASS:
case UTASSERT_CASETYPE_DEBUG:
default:
Expand Down

0 comments on commit ec2d2f6

Please sign in to comment.