summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxenosys
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-13 16:56:21 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-13 16:56:21 +0000
commit8728969392fb21acd6c4d5918a05894b87f323b6 (patch)
tree54baf3e23fc60f064fbd2573df24c637e5855640 /testsuites/psxtests/psxenosys
parent2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-8728969392fb21acd6c4d5918a05894b87f323b6.tar.bz2
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.
Diffstat (limited to 'testsuites/psxtests/psxenosys')
-rw-r--r--testsuites/psxtests/psxenosys/.cvsignore2
-rw-r--r--testsuites/psxtests/psxenosys/Makefile.am28
-rw-r--r--testsuites/psxtests/psxenosys/init.c177
-rw-r--r--testsuites/psxtests/psxenosys/psxenosys.scn32
-rw-r--r--testsuites/psxtests/psxenosys/system.h39
5 files changed, 278 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxenosys/.cvsignore b/testsuites/psxtests/psxenosys/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/psxtests/psxenosys/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/psxtests/psxenosys/Makefile.am b/testsuites/psxtests/psxenosys/Makefile.am
new file mode 100644
index 0000000000..a3bccd7508
--- /dev/null
+++ b/testsuites/psxtests/psxenosys/Makefile.am
@@ -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
diff --git a/testsuites/psxtests/psxenosys/init.c b/testsuites/psxtests/psxenosys/init.c
new file mode 100644
index 0000000000..1d5969a19b
--- /dev/null
+++ b/testsuites/psxtests/psxenosys/init.c
@@ -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 */
+}
diff --git a/testsuites/psxtests/psxenosys/psxenosys.scn b/testsuites/psxtests/psxenosys/psxenosys.scn
new file mode 100644
index 0000000000..1c9b8b17eb
--- /dev/null
+++ b/testsuites/psxtests/psxenosys/psxenosys.scn
@@ -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 ***
diff --git a/testsuites/psxtests/psxenosys/system.h b/testsuites/psxtests/psxenosys/system.h
new file mode 100644
index 0000000000..9177b272bc
--- /dev/null
+++ b/testsuites/psxtests/psxenosys/system.h
@@ -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 */