Files
rtems/testsuites/support/include/test_support.h
Chris Johns 24d0ee57a4 cpukit, testsuite: Add rtems_printf and rtems_printer support.
This change adds rtems_printf and related functions and wraps the
RTEMS print plugin support into a user API. All references to the
plugin are removed and replaced with the rtems_printer interface.

Printk and related functions are made to return a valid number of
characters formatted and output.

The function attribute to check printf functions has been added
to rtems_printf and printk. No changes to remove warrnings are part
of this patch set.

The testsuite has been moved over to the rtems_printer. The testsuite
has a mix of rtems_printer access and direct print control via the
tmacros.h header file. The support for begink/endk has been removed
as it served no purpose and only confused the code base. The testsuite
has not been refactored to use rtems_printf. This is future work.
2016-05-25 15:47:34 +10:00

84 lines
2.1 KiB
C

/*
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#ifndef __TEST_SUPPORT_h
#define __TEST_SUPPORT_h
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Return a pointer to the POSIX name that is slightly
* beyond the legal limit.
*/
const char *Get_Too_Long_Name(void);
/*
* Return a pointer to the longest legal POSIX name.
*/
const char *Get_Longest_Name(void);
/*
* Spin for specified number of ticks.
*/
void rtems_test_spin_for_ticks(int ticks);
/*
* Spin until the next clock tick
*/
void rtems_test_spin_until_next_tick( void );
/*********************************************************************/
/*********************************************************************/
/************** TMTEST SUPPORT **************/
/*********************************************************************/
/*********************************************************************/
/*
* Type of method used for timing operations
*/
typedef void (*rtems_time_test_method_t)(
int iteration,
void *argument
);
/*
* Obtain baseline timing information for benchmark tests.
*/
void rtems_time_test_measure_operation(
const char *description,
rtems_time_test_method_t operation,
void *argument,
int iterations,
int overhead
);
/*********************************************************************/
/*********************************************************************/
/************** TEST SUPPORT **************/
/*********************************************************************/
/*********************************************************************/
void locked_print_initialize(void);
int locked_printf(const char *fmt, ...);
int locked_vprintf(const char *fmt, va_list ap);
void locked_printk(const char *fmt, ...);
#ifdef __cplusplus
};
#endif
#endif