Changeset 24d0ee57 in rtems for testsuites/smptests


Ignore:
Timestamp:
May 20, 2016, 8:39:50 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
1503c1c3
Parents:
b1860df5
git-author:
Chris Johns <chrisj@…> (05/20/16 08:39:50)
git-committer:
Chris Johns <chrisj@…> (05/25/16 05:47:34)
Message:

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.

Location:
testsuites/smptests
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • testsuites/smptests/smp05/init.c

    rb1860df5 r24d0ee57  
    2828static void success(void)
    2929{
    30   rtems_test_end_with_plugin(locked_printf_plugin, NULL);
     30  rtems_test_end();
    3131  rtems_test_exit( 0 );
    3232}
     
    5151
    5252  locked_print_initialize();
    53   rtems_test_begin_with_plugin(locked_printf_plugin, NULL);
     53  rtems_test_begin();
    5454
    5555  if ( rtems_get_processor_count() == 1 ) {
  • testsuites/smptests/smp07/init.c

    rb1860df5 r24d0ee57  
    1919volatile bool TaskRan = false;
    2020volatile bool TSRFired = false;
    21 rtems_id      Semaphore; 
     21rtems_id      Semaphore;
    2222
    2323rtems_task Init(
     
    3131static void success(void)
    3232{
    33   rtems_test_end_with_plugin(locked_printf_plugin, NULL);
     33  rtems_test_end( );
    3434  rtems_test_exit( 0 );
    3535}
     
    6464  /* Print that the task is up and running. */
    6565  locked_printf(
    66     " CPU %" PRIu32 " running Task %s after semaphore release\n", 
    67     cpu_num, 
     66    " CPU %" PRIu32 " running Task %s after semaphore release\n",
     67    cpu_num,
    6868    name
    6969  );
     
    9999
    100100  locked_print_initialize();
    101   rtems_test_begin_with_plugin(locked_printf_plugin, NULL);
     101  rtems_test_begin();
    102102
    103103  if ( rtems_get_processor_count() == 1 ) {
     
    108108  status = rtems_semaphore_create(
    109109    rtems_build_name ('S', 'E', 'M', '1'),
    110     1,                                             
     110    1,
    111111    RTEMS_LOCAL                   |
    112112    RTEMS_SIMPLE_BINARY_SEMAPHORE |
     
    158158      break;
    159159  };
    160  
     160
    161161  /* Validate the timer fired and that the task ran */
    162162  if ( !TSRFired )
  • testsuites/smptests/smpfatal01/init.c

    rb1860df5 r24d0ee57  
    1717#endif
    1818
     19#define TESTS_USE_PRINTK
     20#include "tmacros.h"
     21
    1922#include <rtems.h>
    20 #include <rtems/test.h>
    2123#include <rtems/score/percpu.h>
    2224#include <rtems/score/smpimpl.h>
     
    6365      }
    6466
    65       rtems_test_endk();
     67      TEST_END();
    6668    }
    6769  }
     
    8082  uint32_t cpu;
    8183
    82   rtems_test_begink();
     84  TEST_BEGIN();
    8385
    8486  assert(rtems_configuration_get_maximum_processors() == MAX_CPUS);
     
    108110    per_cpu->state = PER_CPU_STATE_SHUTDOWN;
    109111  } else {
    110     rtems_test_endk();
     112    TEST_END();
    111113    exit(0);
    112114  }
  • testsuites/smptests/smpfatal02/init.c

    rb1860df5 r24d0ee57  
    1717#endif
    1818
     19#define TESTS_USE_PRINTK
     20#include "tmacros.h"
     21
    1922#include <rtems.h>
    20 #include <rtems/test.h>
    2123#include <rtems/score/percpu.h>
    2224#include <rtems/score/smpimpl.h>
     
    6870      }
    6971
    70       rtems_test_endk();
     72      TEST_END();
    7173    } else {
    7274      assert(source == RTEMS_FATAL_SOURCE_SMP);
     
    8890  uint32_t cpu;
    8991
    90   rtems_test_begink();
     92  TEST_BEGIN();
    9193
    9294  assert(rtems_configuration_get_maximum_processors() == MAX_CPUS);
     
    113115    rtems_fatal(RTEMS_FATAL_SOURCE_APPLICATION, 0xdeadbeef);
    114116  } else {
    115     rtems_test_endk();
     117    TEST_END();
    116118    exit(0);
    117119  }
  • testsuites/smptests/smpfatal04/init.c

    rb1860df5 r24d0ee57  
    1717#endif
    1818
     19#define TESTS_USE_PRINTK
     20#include "tmacros.h"
     21
    1922#include <rtems.h>
    20 #include <rtems/test.h>
    2123#include <rtems/score/smpimpl.h>
    2224
     
    3739)
    3840{
    39   rtems_test_begink();
     41  TEST_BEGIN();
    4042
    4143  if (
     
    4446      && code == SMP_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER
    4547  ) {
    46     rtems_test_endk();
     48    TEST_END();
    4749  }
    4850}
  • testsuites/smptests/smpfatal05/init.c

    rb1860df5 r24d0ee57  
    1717#endif
    1818
     19#define TESTS_USE_PRINTK
     20#include "tmacros.h"
     21
    1922#include <rtems.h>
    20 #include <rtems/test.h>
    2123#include <rtems/score/smpimpl.h>
    2224
     
    3739)
    3840{
    39   rtems_test_begink();
     41  TEST_BEGIN();
    4042
    4143  if (
     
    4446      && code == SMP_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT
    4547  ) {
    46     rtems_test_endk();
     48    TEST_END();
    4749  }
    4850}
  • testsuites/smptests/smpfatal08/init.c

    rb1860df5 r24d0ee57  
    1717#endif
    1818
     19#define TESTS_USE_PRINTK
     20#include "tmacros.h"
     21
    1922#include <rtems.h>
    20 #include <rtems/test.h>
    2123#include <rtems/score/smpimpl.h>
    2224
     
    9496)
    9597{
    96   rtems_test_begink();
     98  TEST_BEGIN();
    9799
    98100  if (
     
    101103      && code == SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED
    102104  ) {
    103     rtems_test_endk();
     105    TEST_END();
    104106  }
    105107}
Note: See TracChangeset for help on using the changeset viewer.