Changeset 88271c33 in rtems


Ignore:
Timestamp:
Sep 13, 2009, 8:36:36 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
cd4884a
Parents:
039cb994
Message:

2009-09-13 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac, psx01/init.c, psx01/psx01.scn: Add new test to exercise clock and delay services enabled when POSIX threads are disabled. This is split from psx01. POSIX test suite now enabled when POSIX threads are disabled so only enable tests which are appropriate.
  • psxclock/.cvsignore, psxclock/Makefile.am, psxclock/init.c, psxclock/psxclock.doc, psxclock/psxclock.scn: New files.
Location:
testsuites/psxtests
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    r039cb994 r88271c33  
     12009-09-13      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile.am, configure.ac, psx01/init.c, psx01/psx01.scn: Add new
     4        test to exercise clock and delay services enabled when POSIX threads
     5        are disabled. This is split from psx01. POSIX test suite now enabled
     6        when POSIX threads are disabled so only enable tests which are
     7        appropriate.
     8        * psxclock/.cvsignore, psxclock/Makefile.am, psxclock/init.c,
     9        psxclock/psxclock.doc, psxclock/psxclock.scn: New files.
     10
    1112009-08-19      Joel Sherrill <joel.sherrill@OARcorp.com>
    212
  • testsuites/psxtests/Makefile.am

    r039cb994 r88271c33  
    55ACLOCAL_AMFLAGS = -I ../aclocal
    66
    7 SUBDIRS = psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \
     7SUBDIRS = psxclock
     8if HAS_POSIX
     9SUBDIRS += psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \
    810    psx10 psx11 psx12 psx13 psx14 psxautoinit01 psxautoinit02 psxbarrier01 \
    911    psxcancel psxcleanup psxcond01 psxenosys psxkey01 psxkey02 psxkey03 \
     
    1315    psxualarm psxfatal01 psxfatal02 \
    1416    psxintrcritical01 psxstack01
     17endif
    1518
     19if HAS_POSIX
    1620## File IO tests
    1721SUBDIRS += psxfile01 psxreaddir psxstat psxmount psx13 psxchroot01
     22endif
     23
    1824## Until sys/uio.h is moved to libcsupport, we have to have networking
    1925## enabled to support readv and writev.  Hopefully this is a temporary
    2026## situation.
    2127if HAS_NETWORKING
     28if HAS_POSIX
    2229SUBDIRS += psxrdwrv
     30endif
    2331endif
    2432
  • testsuites/psxtests/configure.ac

    r039cb994 r88271c33  
    2525AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
    2626
     27RTEMS_CHECK_CPUOPTS([RTEMS_POSIX_API])
     28AM_CONDITIONAL(HAS_POSIX,test x"${rtems_cv_RTEMS_POSIX_API}" = x"yes")
     29
    2730# Explicitly list all Makefiles here
    2831AC_CONFIG_FILES([Makefile
     
    4750psxchroot01/Makefile
    4851psxcleanup/Makefile
     52psxclock/Makefile
    4953psxcond01/Makefile
    5054psxenosys/Makefile
  • testsuites/psxtests/psx01/init.c

    r039cb994 r88271c33  
    2424  int             priority;
    2525  pthread_t       thread_id;
    26   time_t          seconds;
    27   time_t          seconds1;
    28   unsigned int    remaining;
    2926  struct tm       tm;
    3027  struct utsname  uts;
    31   useconds_t      useconds;
    3228
    3329  puts( "\n\n*** POSIX TEST 1 ***" );
    34 
    35   tm_build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
    3630
    3731  /* print some system information */
     
    5044  printf( "Init: uts.machine: %s\n", uts.machine );
    5145  puts("");
    52 
    53   /* error cases in clock_gettime and clock_settime */
    54 
    55   puts( "Init: clock_gettime - EINVAL (NULL timespec)" );
    56   status = clock_gettime( CLOCK_REALTIME, NULL );
    57   rtems_test_assert( status == -1 );
    58   rtems_test_assert( errno == EINVAL );
    59 
    60   puts( "Init: clock_gettime - EINVAL (invalid clockid)" );
    61   status = clock_gettime( (clockid_t)-1, &tv );
    62   rtems_test_assert( status == -1 );
    63   rtems_test_assert( errno == EINVAL );
    64 
    65   puts( "Init: clock_settime - EINVAL (invalid clockid)" );
    66   status = clock_settime( (clockid_t)-1, &tv );
    67   rtems_test_assert( status == -1 );
    68   rtems_test_assert( errno == EINVAL );
    69 
    70   /* way back near the dawn of time :D */
    71   tv.tv_sec = 1;
    72   tv.tv_nsec = 0;
    73   printf( ctime( &tv.tv_sec ) );
    74   puts( "Init: clock_settime - before 1988 EINVAL" );
    75   status = clock_settime( CLOCK_REALTIME, &tv );
    76   rtems_test_assert( status == -1 );
    77   rtems_test_assert( errno == EINVAL );
    78 
    79   /* exercise clock_getres */
    80 
    81   puts( "Init: clock_getres - EINVAL (invalid clockid)" );
    82   status = clock_getres( (clockid_t) -1, &tv );
    83   rtems_test_assert( status == -1 );
    84   rtems_test_assert( errno == EINVAL );
    85 
    86   puts( "Init: clock_getres - EINVAL (NULL resolution)" );
    87   status = clock_getres( CLOCK_REALTIME, NULL );
    88   rtems_test_assert( status == -1 );
    89   rtems_test_assert( errno == EINVAL );
    90 
    91   puts( "Init: clock_getres - SUCCESSFUL" );
    92   status = clock_getres( CLOCK_REALTIME, &tv );
    93   printf( "Init: resolution = sec (%ld), nsec (%ld)\n", tv.tv_sec, tv.tv_nsec );
    94   rtems_test_assert( !status );
    95 
    96   /* set the time of day, and print our buffer in multiple ways */
    97 
    98   tv.tv_sec = mktime( &tm );
    99   rtems_test_assert( tv.tv_sec != -1 );
    100 
    101   tv.tv_nsec = 0;
    102 
    103   /* now set the time of day */
    104 
    105   empty_line();
    106 
    107   printf( asctime( &tm ) );
    108   puts( "Init: clock_settime - SUCCESSFUL" );
    109   status = clock_settime( CLOCK_REALTIME, &tv );
    110   rtems_test_assert( !status );
    111 
    112   printf( asctime( &tm ) );
    113   printf( ctime( &tv.tv_sec ) );
    114 
    115   /* use sleep to delay */
    116 
    117   remaining = sleep( 3 );
    118   rtems_test_assert( !remaining );
    119  
    120   /* print new times to make sure it has changed and we can get the realtime */
    121   status = clock_gettime( CLOCK_PROCESS_CPUTIME, &tv );
    122   rtems_test_assert( !status );
    123   printf("Time since boot: (%d, %d)\n", tv.tv_sec,tv.tv_nsec );
    124 
    125   status = clock_gettime( CLOCK_REALTIME, &tv );
    126   rtems_test_assert( !status );
    127 
    128   printf( ctime( &tv.tv_sec ) );
    129 
    130   seconds = time( NULL );
    131   printf( ctime( &seconds ) );
    132 
    133   /*  just to have the value copied out through the parameter */
    134 
    135   seconds = time( &seconds1 );
    136   rtems_test_assert( seconds == seconds1 );
    137 
    138   /* check the time remaining */
    139 
    140   printf( "Init: seconds remaining (%d)\n", (int)remaining );
    141   rtems_test_assert( !remaining );
    142 
    143   /* error cases in nanosleep */
    144 
    145   empty_line();
    146   puts( "Init: nanosleep - EINVAL (NULL time)" );
    147   status = nanosleep ( NULL, &tr );
    148   rtems_test_assert( status == -1 );
    149   rtems_test_assert( errno == EINVAL );
    150 
    151   tv.tv_sec = 0;
    152   tv.tv_nsec = TOD_NANOSECONDS_PER_SECOND * 2;
    153   puts( "Init: nanosleep - EINVAL (too many nanoseconds)" );
    154   status = nanosleep ( &tv, &tr );
    155   rtems_test_assert( status == -1 );
    156   rtems_test_assert( errno == EINVAL );
    157 
    158   /* this is actually a small delay or yield */
    159   tv.tv_sec = -1;
    160   tv.tv_nsec = 0;
    161   puts( "Init: nanosleep - negative seconds small delay " );
    162   status = nanosleep ( &tv, &tr );
    163   rtems_test_assert( status == -1 );
    164   rtems_test_assert( errno == EINVAL );
    165 
    166   /* use nanosleep to yield */
    167 
    168   tv.tv_sec = 0;
    169   tv.tv_nsec = 0;
    170 
    171   puts( "Init: nanosleep - yield with remaining" );
    172   status = nanosleep ( &tv, &tr );
    173   rtems_test_assert( !status );
    174   rtems_test_assert( !tr.tv_sec );
    175   rtems_test_assert( !tr.tv_nsec );
    176 
    177   puts( "Init: nanosleep - yield with NULL time remaining" );
    178   status = nanosleep ( &tv, NULL );
    179   rtems_test_assert( !status );
    180   rtems_test_assert( !tr.tv_sec );
    181   rtems_test_assert( !tr.tv_nsec );
    182 
    183   /* use nanosleep to delay */
    184 
    185   tv.tv_sec = 3;
    186   tv.tv_nsec = 500000;
    187 
    188   puts( "Init: nanosleep - 1.05 seconds" );
    189   status = nanosleep ( &tv, &tr );
    190   rtems_test_assert( !status );
    191 
    192   /* print the current real time again */
    193   status = clock_gettime( CLOCK_REALTIME, &tv );
    194   rtems_test_assert( !status );
    195   printf( ctime( &tv.tv_sec ) );
    196 
    197   /* check the time remaining */
    198 
    199   printf( "Init: sec (%ld), nsec (%ld) remaining\n", tr.tv_sec, tr.tv_nsec );
    200   rtems_test_assert( !tr.tv_sec && !tr.tv_nsec );
    201 
    202   puts( "Init: usleep - 1.35 seconds" );
    203   useconds = usleep ( 1350000 );
    204   rtems_test_assert( useconds < 1350000 );
    205  
    206   /* print the current real time again */
    207   status = clock_gettime( CLOCK_REALTIME, &tv );
    208   rtems_test_assert( !status );
    209   printf( ctime( &tv.tv_sec ) );
    21046
    21147  /* get id of this thread */
  • testsuites/psxtests/psx01/psx01.scn

    r039cb994 r88271c33  
    99Init: uts.machine: ARM/ARMv4T
    1010
    11 Init: clock_gettime - EINVAL (NULL timespec)
    12 Init: clock_gettime - EINVAL (invalid clockid)
    13 Init: clock_settime - EINVAL (invalid clockid)
    14 Thu Jan  1 00:00:01 1970
    15 Init: clock_settime - before 1988 EINVAL
    16 Init: clock_getres - EINVAL (invalid clockid)
    17 Init: clock_getres - EINVAL (NULL resolution)
    18 Init: clock_getres - SUCCESSFUL
    19 Init: resolution = sec (0), nsec (10000000)
    20 
    21 Fri May 24 11:05:00 1996
    22 Init: clock_settime - SUCCESSFUL
    23 Fri May 24 11:05:00 1996
    24 Fri May 24 11:05:00 1996
    25 Time since boot: (3, 20000000)
    26 Fri May 24 11:05:03 1996
    27 Fri May 24 11:05:03 1996
    28 Init: seconds remaining (0)
    29 
    30 Init: nanosleep - EINVAL (NULL time)
    31 Init: nanosleep - EINVAL (too many nanoseconds)
    32 Init: nanosleep - negative seconds small delay
    33 Init: nanosleep - yield with remaining
    34 Init: nanosleep - yield with NULL time remaining
    35 Init: nanosleep - 1.05 seconds
    36 Fri May 24 11:05:06 1996
    37 Init: sec (0), nsec (0) remaining
    38 Init: usleep - 1.35 seconds
    39 Fri May 24 11:05:07 1996
    4011Init: ID is 0x0b010001
    4112Init: sched_get_priority_min (SCHED_FIFO) -- 1
Note: See TracChangeset for help on using the changeset viewer.