ChibiOS/RT Logo ChibiOS/RT

Architecture - Reference Manual - Guides

Data Structures | Defines | Functions | Variables

Test Runtime


Description

Runtime code for the test suite execution, this code is not part of the OS and should not be included in user applications.

Data Structures

struct  testcase
 Structure representing a test case. More...

Defines

#define DELAY_BETWEEN_TESTS   200
 Delay inserted between test cases.
#define TEST_NO_BENCHMARKS   FALSE
 If TRUE then benchmarks are not included.
#define test_fail(point)
 Test failure enforcement.
#define test_assert(point, condition, msg)
 Test assertion.
#define test_assert_sequence(point, expected)
 Test sequence assertion.
#define test_assert_time_window(point, start, end)
 Test time window assertion.

Functions

void test_printn (uint32_t n)
 Prints a decimal unsigned number.
void test_print (char *msgp)
 Prints a line without final end-of-line.
void test_println (char *msgp)
 Prints a line.
void test_emit_token (char token)
 Emits a token into the tokens buffer.
void test_terminate_threads (void)
 Pends a termination request in all the test-spawned threads.
void test_wait_threads (void)
 Waits for the completion of all the test-spawned threads.
void test_cpu_pulse (unsigned duration)
 CPU pulse.
systime_t test_wait_tick (void)
 Delays execution until next system time tick.
void test_start_timer (unsigned ms)
 Starts the test timer.
msg_t TestThread (void *p)
 Test execution thread function.

Variables

bool_t test_timer_done
 Set to TRUE when the test timer reaches its deadline.

Define Documentation

#define DELAY_BETWEEN_TESTS   200

Delay inserted between test cases.

Definition at line 42 of file test.h.

#define TEST_NO_BENCHMARKS   FALSE

If TRUE then benchmarks are not included.

Definition at line 49 of file test.h.

#define test_fail (   point  ) 
Value:
{                                                  \
  _test_fail(point);                                                        \
  return;                                                                   \
}

Test failure enforcement.

Definition at line 118 of file test.h.

#define test_assert (   point,
  condition,
  msg 
)
Value:
{                                \
  if (_test_assert(point, condition))                                       \
    return;                                                                 \
}

Test assertion.

Parameters:
[in] point numeric assertion identifier
[in] condition a boolean expression that must be verified to be true
[in] msg failure message

Definition at line 130 of file test.h.

#define test_assert_sequence (   point,
  expected 
)
Value:
{                             \
  if (_test_assert_sequence(point, expected))                               \
    return;                                                                 \
}

Test sequence assertion.

Parameters:
[in] point numeric assertion identifier
[in] expected string to be matched with the tokens buffer

Definition at line 141 of file test.h.

#define test_assert_time_window (   point,
  start,
  end 
)
Value:
{                        \
  if (_test_assert_time_window(point, start, end))                          \
    return;                                                                 \
}

Test time window assertion.

Parameters:
[in] point numeric assertion identifier
[in] start initial time in the window (included)
[in] end final time in the window (not included)

Definition at line 153 of file test.h.


Function Documentation

void test_printn ( uint32_t  n  ) 

Prints a decimal unsigned number.

Parameters:
[in] n the number to be printed
void test_print ( char *  msgp  ) 

Prints a line without final end-of-line.

Parameters:
[in] msgp the message
void test_println ( char *  msgp  ) 

Prints a line.

Parameters:
[in] msgp the message
void test_emit_token ( char  token  ) 

Emits a token into the tokens buffer.

Parameters:
[in] token the token as a char
void test_terminate_threads ( void   ) 

Pends a termination request in all the test-spawned threads.

void test_wait_threads ( void   ) 

Waits for the completion of all the test-spawned threads.

void test_cpu_pulse ( unsigned  duration  ) 

CPU pulse.

Note:
The current implementation is not totally reliable.
Parameters:
[in] duration CPU pulse duration in milliseconds
systime_t test_wait_tick ( void   ) 

Delays execution until next system time tick.

void test_start_timer ( unsigned  ms  ) 

Starts the test timer.

Parameters:
[in] ms time in milliseconds
msg_t TestThread ( void *  p  ) 

Test execution thread function.

Parameters:
[in] p pointer to a BaseChannel object for test output

Variable Documentation

Set to TRUE when the test timer reaches its deadline.

Definition at line 265 of file test.c.


Generated on Sun Oct 24 2010 09:40:48 for ChibiOS/RT by doxygen 1.7.1