forked from Imagelibrary/rtems
2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: New test to cover all RTEMS POSIX functions that return ENOSYS. * psxenosys/.cvsignore, psxenosys/Makefile.am, psxenosys/init.c, psxenosys/psxenosys.scn, psxenosys/system.h: New files.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am, configure.ac: New test to cover all RTEMS POSIX
|
||||
functions that return ENOSYS.
|
||||
* psxenosys/.cvsignore, psxenosys/Makefile.am, psxenosys/init.c,
|
||||
psxenosys/psxenosys.scn, psxenosys/system.h: New files.
|
||||
|
||||
2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* psx13/test.c: Fix spelling error.
|
||||
|
||||
@@ -6,7 +6,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal
|
||||
|
||||
SUBDIRS = psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \
|
||||
psx10 psx11 psx12 psxtime psxtimer psxcancel psxbarrier01 psxmsgq01 \
|
||||
psxrwlock01 psxsem01 psxspin01
|
||||
psxrwlock01 psxsem01 psxspin01 psxenosys
|
||||
|
||||
## File IO tests
|
||||
SUBDIRS += psxfile01 psxreaddir psxstat psxmount psx13 psxchroot01
|
||||
|
||||
@@ -43,6 +43,7 @@ psx13/Makefile
|
||||
psxbarrier01/Makefile
|
||||
psxcancel/Makefile
|
||||
psxchroot01/Makefile
|
||||
psxenosys/Makefile
|
||||
psxfile01/Makefile
|
||||
psxhdrs/Makefile
|
||||
psxmount/Makefile
|
||||
|
||||
2
testsuites/psxtests/psxenosys/.cvsignore
Normal file
2
testsuites/psxtests/psxenosys/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
28
testsuites/psxtests/psxenosys/Makefile.am
Normal file
28
testsuites/psxtests/psxenosys/Makefile.am
Normal file
@@ -0,0 +1,28 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = psxenosys.exe
|
||||
psxenosys_exe_SOURCES = init.c system.h ../include/pmacros.h
|
||||
|
||||
dist_rtems_tests_DATA = psxenosys.scn
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
psxenosys_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(psxenosys_exe_OBJECTS) $(psxenosys_exe_LDADD)
|
||||
LINK_LIBS = $(psxenosys_exe_LDLIBS)
|
||||
|
||||
psxenosys.exe$(EXEEXT): $(psxenosys_exe_OBJECTS) $(psxenosys_exe_DEPENDENCIES)
|
||||
@rm -f psxenosys.exe$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
177
testsuites/psxtests/psxenosys/init.c
Normal file
177
testsuites/psxtests/psxenosys/init.c
Normal file
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2007.
|
||||
* 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.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
|
||||
#include <aio.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <devctl.h>
|
||||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
|
||||
void check_enosys(int status)
|
||||
{
|
||||
if ( (status == -1) && (errno == ENOSYS) )
|
||||
return;
|
||||
puts( "ERROR -- did not return ENOSYS as expected" );
|
||||
rtems_test_exit(0);
|
||||
}
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int sc;
|
||||
|
||||
puts( "\n\n*** POSIX TEST -- ENOSYS ***" );
|
||||
|
||||
puts( "aio_read -- ENOSYS" );
|
||||
sc = aio_read( NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "aio_write -- ENOSYS" );
|
||||
sc = aio_write( NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "lio_listio -- ENOSYS" );
|
||||
sc = lio_listio( 0, NULL, 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "aio_error -- ENOSYS" );
|
||||
sc = aio_error( NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "aio_return -- ENOSYS" );
|
||||
sc = aio_return( NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "aio_cancel -- ENOSYS" );
|
||||
sc = aio_cancel( 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "aio_suspend -- ENOSYS" );
|
||||
sc = aio_suspend( NULL, 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "aio_fsync -- ENOSYS" );
|
||||
sc = aio_fsync( 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "clock_getcpuclockid -- ENOSYS" );
|
||||
sc = clock_getcpuclockid( 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "clock_getenable_attr -- ENOSYS" );
|
||||
sc = clock_getenable_attr( 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "clock_setenable_attr -- ENOSYS" );
|
||||
sc = clock_setenable_attr( 0, 0 );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "clock_gettime - CLOCK_THREAD_CPUTIME -- ENOSYS" );
|
||||
#if defined(_POSIX_THREAD_CPUTIME)
|
||||
{
|
||||
struct timespec tp;
|
||||
sc = clock_gettime( CLOCK_THREAD_CPUTIME, &tp );
|
||||
check_enosys( sc );
|
||||
}
|
||||
#endif
|
||||
|
||||
puts( "clock_settime - CLOCK_PROCESS_CPUTIME -- ENOSYS" );
|
||||
#if defined(_POSIX_CPUTIME)
|
||||
{
|
||||
struct timespec tp;
|
||||
sc = clock_settime( CLOCK_PROCESS_CPUTIME, &tp );
|
||||
check_enosys( sc );
|
||||
}
|
||||
#endif
|
||||
|
||||
puts( "clock_settime - CLOCK_THREAD_CPUTIME -- ENOSYS" );
|
||||
#if defined(_POSIX_THREAD_CPUTIME)
|
||||
{
|
||||
struct timespec tp;
|
||||
sc = clock_settime( CLOCK_THREAD_CPUTIME, &tp );
|
||||
check_enosys( sc );
|
||||
}
|
||||
#endif
|
||||
|
||||
puts( "devctl -- ENOSYS" );
|
||||
sc = devctl( 0, NULL, 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "execl -- ENOSYS" );
|
||||
sc = execl( NULL, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "execle -- ENOSYS" );
|
||||
sc = execle( NULL, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "execlp -- ENOSYS" );
|
||||
sc = execlp( NULL, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "execv -- ENOSYS" );
|
||||
sc = execv( NULL, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "execve -- ENOSYS" );
|
||||
sc = execve( NULL, NULL, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "execvp -- ENOSYS" );
|
||||
sc = execvp( NULL, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "fork -- ENOSYS" );
|
||||
sc = fork();
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "pthread_atfork -- ENOSYS" );
|
||||
sc = pthread_atfork( NULL, NULL, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "pthread_getcpuclockid -- ENOSYS" );
|
||||
sc = pthread_getcpuclockid( 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "sched_setparam -- ENOSYS" );
|
||||
sc = sched_setparam( 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "sched_getparam -- ENOSYS" );
|
||||
sc = sched_getparam( 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "sched_setscheduler -- ENOSYS" );
|
||||
sc = sched_setscheduler( 0, 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "sched_getscheduler -- ENOSYS" );
|
||||
sc = sched_setscheduler( 0, 0, NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "wait -- ENOSYS" );
|
||||
sc = wait( NULL );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "waitpid -- ENOSYS" );
|
||||
sc = waitpid( 0, NULL, 0 );
|
||||
check_enosys( sc );
|
||||
|
||||
puts( "*** END OF POSIX TEST ENOSYS ***" );
|
||||
rtems_test_exit( 0 );
|
||||
|
||||
return NULL; /* just so the compiler thinks we returned something */
|
||||
}
|
||||
32
testsuites/psxtests/psxenosys/psxenosys.scn
Normal file
32
testsuites/psxtests/psxenosys/psxenosys.scn
Normal file
@@ -0,0 +1,32 @@
|
||||
*** POSIX TEST -- ENOSYS ***
|
||||
aio_read -- ENOSYS
|
||||
aio_write -- ENOSYS
|
||||
lio_listio -- ENOSYS
|
||||
aio_error -- ENOSYS
|
||||
aio_return -- ENOSYS
|
||||
aio_cancel -- ENOSYS
|
||||
aio_suspend -- ENOSYS
|
||||
aio_fsync -- ENOSYS
|
||||
clock_getcpuclockid -- ENOSYS
|
||||
clock_getenable_attr -- ENOSYS
|
||||
clock_setenable_attr -- ENOSYS
|
||||
clock_gettime - CLOCK_THREAD_CPUTIME -- ENOSYS
|
||||
clock_settime - CLOCK_PROCESS_CPUTIME -- ENOSYS
|
||||
clock_settime - CLOCK_THREAD_CPUTIME -- ENOSYS
|
||||
devctl -- ENOSYS
|
||||
execl -- ENOSYS
|
||||
execle -- ENOSYS
|
||||
execlp -- ENOSYS
|
||||
execv -- ENOSYS
|
||||
execve -- ENOSYS
|
||||
execvp -- ENOSYS
|
||||
fork -- ENOSYS
|
||||
pthread_atfork -- ENOSYS
|
||||
pthread_getcpuclockid -- ENOSYS
|
||||
sched_setparam -- ENOSYS
|
||||
sched_getparam -- ENOSYS
|
||||
sched_setscheduler -- ENOSYS
|
||||
sched_getscheduler -- ENOSYS
|
||||
wait -- ENOSYS
|
||||
waitpid -- ENOSYS
|
||||
*** END OF POSIX TEST ENOSYS ***
|
||||
39
testsuites/psxtests/psxenosys/system.h
Normal file
39
testsuites/psxtests/psxenosys/system.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/* system.h
|
||||
*
|
||||
* This include file contains information that is included in every
|
||||
* function in the test set.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* 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.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* functions */
|
||||
|
||||
#include <pmacros.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
|
||||
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
/* end of include file */
|
||||
Reference in New Issue
Block a user