summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-04-20 21:30:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-04-20 21:30:15 +0000
commita2f875f222865a6a92c980418e6a6094fcff9089 (patch)
tree4f4e32ed156695ca921004442d0c6d90d40f453b /testsuites
parent2011-04-20 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-a2f875f222865a6a92c980418e6a6094fcff9089.tar.bz2
2011-04-20 Joel Sherrill <joel.sherrill@oarcorp.com>
Add initial test to File System Test Suite. * .cvsignore, ChangeLog, Makefile.am, configure.ac, fs01/fs91.doc, fs01/init.c, imfs_fs01/.cvsignore, imfs_fs01/Makefile.am, imfs_fs01/imfs_fs01.scn, imfs_support/fs_config.h, imfs_support/fs_support.c, mimfs_fs01/.cvsignore, mimfs_fs01/Makefile.am, mimfs_fs01/mimfs_fs01.scn, mimfs_support/fs_config.h, mimfs_support/fs_support.c: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/fstests/.cvsignore15
-rw-r--r--testsuites/fstests/ChangeLog10
-rw-r--r--testsuites/fstests/Makefile.am15
-rw-r--r--testsuites/fstests/configure.ac84
-rw-r--r--testsuites/fstests/imfs_support/fs_config.h10
-rw-r--r--testsuites/fstests/imfs_support/fs_support.c11
-rw-r--r--testsuites/fstests/mimfs_support/fs_config.h10
-rw-r--r--testsuites/fstests/mimfs_support/fs_support.c41
8 files changed, 196 insertions, 0 deletions
diff --git a/testsuites/fstests/.cvsignore b/testsuites/fstests/.cvsignore
new file mode 100644
index 0000000000..a648c8a5b5
--- /dev/null
+++ b/testsuites/fstests/.cvsignore
@@ -0,0 +1,15 @@
+aclocal.m4
+autom4te*.cache
+config.cache
+config.guess
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+Makefile
+Makefile.in
+missing
+mkinstalldirs
diff --git a/testsuites/fstests/ChangeLog b/testsuites/fstests/ChangeLog
new file mode 100644
index 0000000000..718d519952
--- /dev/null
+++ b/testsuites/fstests/ChangeLog
@@ -0,0 +1,10 @@
+2011-04-20 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ Add initial test to File System Test Suite.
+ * .cvsignore, ChangeLog, Makefile.am, configure.ac, fs01/fs91.doc,
+ fs01/init.c, imfs_fs01/.cvsignore, imfs_fs01/Makefile.am,
+ imfs_fs01/imfs_fs01.scn, imfs_support/fs_config.h,
+ imfs_support/fs_support.c, mimfs_fs01/.cvsignore,
+ mimfs_fs01/Makefile.am, mimfs_fs01/mimfs_fs01.scn,
+ mimfs_support/fs_config.h, mimfs_support/fs_support.c: New files.
+
diff --git a/testsuites/fstests/Makefile.am b/testsuites/fstests/Makefile.am
new file mode 100644
index 0000000000..be97f600d7
--- /dev/null
+++ b/testsuites/fstests/Makefile.am
@@ -0,0 +1,15 @@
+##
+## $Id$
+##
+
+ACLOCAL_AMFLAGS = -I ../aclocal
+
+SUBDIRS = \
+ imfs_fs01 \
+ mimfs_fs01
+
+DIST_SUBDIRS = $(SUBDIRS)
+EXTRA_DIST = fs01/init.c fs01/fs01.doc
+
+include $(top_srcdir)/../automake/subdirs.am
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/fstests/configure.ac b/testsuites/fstests/configure.ac
new file mode 100644
index 0000000000..425e581187
--- /dev/null
+++ b/testsuites/fstests/configure.ac
@@ -0,0 +1,84 @@
+## Process this file with autoconf to produce a configure script.
+##
+## $Id$
+
+AC_PREREQ([2.68])
+AC_INIT([rtems-c-src-tests-fstests],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
+AC_CONFIG_SRCDIR([imfs_support])
+RTEMS_TOP([../..],[..])
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE([no-define foreign 1.11.1])
+AM_MAINTAINER_MODE
+
+RTEMS_ENV_RTEMSBSP
+
+RTEMS_PROJECT_ROOT
+
+RTEMS_PROG_CC_FOR_TARGET
+
+RTEMS_CANONICALIZE_TOOLS
+
+RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
+AC_CONFIG_HEADER([config.h])
+
+RTEMS_CHECK_CPUOPTS([RTEMS_POSIX_API])
+AM_CONDITIONAL(HAS_POSIX,test x"${rtems_cv_RTEMS_POSIX_API}" = x"yes")
+
+# but newlib doesn't have sys/mman.h
+AC_CHECK_HEADERS([sys/mman.h])
+
+# FIXME: newlib should supply declaration of pthread_rwlock_unlock()
+AC_CHECK_DECLS([pthread_rwlock_unlock],[],[],[[#include <pthread.h>]])
+
+# FIXME: newlib should supply declaration of pthread_atfork()
+AC_CHECK_DECLS([pthread_atfork],[],[],[[#include <pthread.h>]])
+
+# FIXME: RTEMS presumes pthread_attr_getcputime to be IEEE Std 1003.1
+# Likely an anachronism in RTEMS.
+AC_CHECK_DECLS([pthread_attr_getcputime],[],[],[[#include <pthread.h>]])
+
+# FIXME: RTEMS presumes pthread_attr_getcputime to be IEEE Std 1003.1
+# Likely an anachronism in RTEMS.
+AC_CHECK_DECLS([pthread_attr_getcputime],[],[],[[#include <pthread.h>]])
+
+# FIXME: RTEMS presumes pthread_attr_setcputime to be IEEE Std 1003.1
+# Likely an anachronism in RTEMS.
+AC_CHECK_DECLS([pthread_attr_setcputime],[],[],[[#include <pthread.h>]])
+
+# Added to pthreads after initial revision. May not be in toolset
+AC_CHECK_DECLS([pthread_attr_getstack],[],[],[[#include <pthread.h>]])
+
+# Added to pthreads after initial revision. May not be in toolset
+AC_CHECK_DECLS([pthread_attr_setstack],[],[],[[#include <pthread.h>]])
+
+# Added to pthreads after initial revision. May not be in toolset
+AC_CHECK_DECLS([pthread_attr_getguardsize],[],[],[[#include <pthread.h>]])
+
+# Added to pthreads after initial revision. May not be in toolset
+AC_CHECK_DECLS([pthread_attr_setguardsize],[],[],[[#include <pthread.h>]])
+
+# FIXME: adjtime is a non-standardized BSD/Linux extension
+# RTEMS should not rely on adjtime
+AC_CHECK_DECLS([adjtime],[],[],[[#include <sys/time.h>]])
+
+# FIXME: IEEE Std 1003.1-2008 mandates mprotect in sys/mman.h,
+# RTEMS provides a stub, despite newlib doesn't have sys/mman.h
+AC_CHECK_DECLS([mprotect],[],[],[[#include <sys/mman.h>]])
+
+# FIXME: IEEE Std 1003.1-2008 mandates seteuid in unistd.h
+# RTEMS provides it, despite newlib doesn't declare it.
+AC_CHECK_DECLS([seteuid],[],[],[#include <unistd.h>])
+
+# FIXME: We should get rid of this. It's a cludge.
+AC_CHECK_SIZEOF([off_t])
+AC_CHECK_SIZEOF([blksize_t])
+AC_CHECK_SIZEOF([blkcnt_t])
+
+# Explicitly list all Makefiles here
+AC_CONFIG_FILES([Makefile
+imfs_fs01/Makefile
+mimfs_fs01/Makefile
+])
+AC_OUTPUT
diff --git a/testsuites/fstests/imfs_support/fs_config.h b/testsuites/fstests/imfs_support/fs_config.h
new file mode 100644
index 0000000000..6ee3dae806
--- /dev/null
+++ b/testsuites/fstests/imfs_support/fs_config.h
@@ -0,0 +1,10 @@
+/*
+ * $Id$
+ */
+
+#define FILESYSTEM "IMFS"
+#define BASE_FOR_TEST ""
+
+extern void test_initialize_filesystem(void);
+
+extern void test_shutdown_filesystem(void);
diff --git a/testsuites/fstests/imfs_support/fs_support.c b/testsuites/fstests/imfs_support/fs_support.c
new file mode 100644
index 0000000000..0d6741ba3b
--- /dev/null
+++ b/testsuites/fstests/imfs_support/fs_support.c
@@ -0,0 +1,11 @@
+/*
+ * $Id$
+ */
+
+void test_initialize_filesystem(void)
+{
+}
+
+void test_shutdown_filesystem(void)
+{
+}
diff --git a/testsuites/fstests/mimfs_support/fs_config.h b/testsuites/fstests/mimfs_support/fs_config.h
new file mode 100644
index 0000000000..5cc6f02539
--- /dev/null
+++ b/testsuites/fstests/mimfs_support/fs_config.h
@@ -0,0 +1,10 @@
+/*
+ * $Id$
+ */
+
+#define FILESYSTEM "MOUNTED IMFS"
+#define BASE_FOR_TEST "/mnt/"
+
+extern void test_initialize_filesystem(void);
+
+extern void test_shutdown_filesystem(void);
diff --git a/testsuites/fstests/mimfs_support/fs_support.c b/testsuites/fstests/mimfs_support/fs_support.c
new file mode 100644
index 0000000000..ee8a904060
--- /dev/null
+++ b/testsuites/fstests/mimfs_support/fs_support.c
@@ -0,0 +1,41 @@
+/*
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "pmacros.h"
+#include "fs_config.h"
+
+#include <rtems/libio.h>
+
+void test_initialize_filesystem(void)
+{
+ int rc;
+
+ rc = mkdir( BASE_FOR_TEST, 0777 );
+ rtems_test_assert( rc == 0 );
+
+ rc = mount(
+ "null",
+ BASE_FOR_TEST,
+ "imfs",
+ RTEMS_FILESYSTEM_READ_ONLY,
+ NULL
+ );
+ rtems_test_assert( rc == 0 );
+}
+
+void test_shutdown_filesystem(void)
+{
+ int rc;
+
+ rc = unmount( BASE_FOR_TEST );
+ rtems_test_assert( rc == 0 );
+
+}