source: rtems/testsuites/samples/hello/init.c @ 24d0ee57

5
Last change on this file since 24d0ee57 was 24d0ee57, checked in by Chris Johns <chrisj@…>, on 05/20/16 at 08:39:50

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.

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[5f0cd34]1/*
2 *  COPYRIGHT (c) 1989-2012.
[ac7d5ef0]3 *  On-Line Applications Research Corporation (OAR).
4 *
[98e4ebf5]5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
[c499856]7 *  http://www.rtems.org/license/LICENSE.
[ac7d5ef0]8 */
9
[e313551]10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
[9391f6d]14#include <rtems/test.h>
15
[7173c437]16#include <bsp.h> /* for device driver prototypes */
17
[ac7d5ef0]18#include <stdio.h>
[d25d17b]19#include <stdlib.h>
[ac7d5ef0]20
[5f0cd34]21/* forward declarations to avoid warnings */
22rtems_task Init(rtems_task_argument argument);
23
[9391f6d]24const char rtems_test_name[] = "HELLO WORLD";
[24d0ee57]25rtems_printer rtems_test_printer;
[9391f6d]26
[ac7d5ef0]27rtems_task Init(
28  rtems_task_argument ignored
29)
30{
[24d0ee57]31  rtems_print_printer_printf(&rtems_test_printer);
[9391f6d]32  rtems_test_begin();
[ac7d5ef0]33  printf( "Hello World\n" );
[9391f6d]34  rtems_test_end();
[ac7d5ef0]35  exit( 0 );
36}
[7173c437]37
38
39/* NOTICE: the clock driver is explicitly disabled */
40#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
41#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
42
43#define CONFIGURE_MAXIMUM_TASKS            1
44#define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
45
46#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
47
[9391f6d]48#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
49
[7173c437]50#define CONFIGURE_INIT
51#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.