Changeset 45a0f65 in rtems-docs


Ignore:
Timestamp:
Feb 9, 2020, 10:09:22 AM (5 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
b6c61e3
Parents:
a4b23d9
git-author:
Sebastian Huber <sebastian.huber@…> (02/09/20 10:09:22)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/10/20 06:35:58)
Message:

eng: Document test framework formatted output

Update #3199.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • eng/test-framework.rst

    ra4b23d9 r45a0f65  
    983983    E:stat:N:1:F:0
    984984
    985 Custom Log Messages
    986 -------------------
    987 
    988 You can print custom log messages with the `T_log()` function:
     985Log Messages and Formatted Output
     986---------------------------------
     987
     988You can print log messages with the `T_log()` function:
    989989
    990990.. code-block:: c
     
    995995
    996996.. code-block:: c
    997     :caption: Custom Log Message Example
     997    :caption: Log Message Example
    998998
    999999    #include <t.h>
     
    10011001    T_TEST_CASE(log)
    10021002    {
    1003         T_log(T_NORMAL, "a custom message %i, %i, %i", 1, 2, 3);
     1003        T_log(T_NORMAL, "a log message %i, %i, %i", 1, 2, 3);
    10041004        T_set_verbosity(T_QUIET);
    10051005        T_log(T_NORMAL, "not verbose enough");
     
    10071007
    10081008.. code-block:: none
    1009     :caption: Custom Log Message Report
     1009    :caption: Log Message Report
    10101010
    10111011    B:log
    1012     L:a custom message 1, 2, 3
     1012    L:a log message 1, 2, 3
    10131013    E:log:N:0:F:0
     1014
     1015You can use the following functions to print formatted output:
     1016
     1017.. code-block:: c
     1018
     1019    int T_printf(char const *, ...);
     1020
     1021    int T_vprintf(char const *, va_list);
     1022
     1023    int T_snprintf(char *, size_t, const char *, ...);
     1024
     1025In contrast to the corresponding standard C library functions, floating-point
     1026and exotic formats may be not supported.  On some architectures supported by
     1027RTEMS, floating-point operations are only supported in special tasks and may be
     1028forbidden in interrupt context.  The formatted output functions provided by the
     1029test framework work in every context.
    10141030
    10151031Time Services
Note: See TracChangeset for help on using the changeset viewer.