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

Last change on this file since 24d0ee57 was 24d0ee57, checked in by Chris Johns <chrisj@…>, on May 20, 2016 at 8:39:50 AM

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
Line 
1/*
2 *  COPYRIGHT (c) 1989-2012.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <rtems/test.h>
15
16#include <bsp.h> /* for device driver prototypes */
17
18#include <stdio.h>
19#include <stdlib.h>
20
21/* forward declarations to avoid warnings */
22rtems_task Init(rtems_task_argument argument);
23
24const char rtems_test_name[] = "HELLO WORLD";
25rtems_printer rtems_test_printer;
26
27rtems_task Init(
28  rtems_task_argument ignored
29)
30{
31  rtems_print_printer_printf(&rtems_test_printer);
32  rtems_test_begin();
33  printf( "Hello World\n" );
34  rtems_test_end();
35  exit( 0 );
36}
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
48#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
49
50#define CONFIGURE_INIT
51#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.