From a2f875f222865a6a92c980418e6a6094fcff9089 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 20 Apr 2011 21:30:15 +0000 Subject: 2011-04-20 Joel Sherrill 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. --- testsuites/fstests/.cvsignore | 15 +++++ testsuites/fstests/ChangeLog | 10 ++++ testsuites/fstests/Makefile.am | 15 +++++ testsuites/fstests/configure.ac | 84 +++++++++++++++++++++++++++ testsuites/fstests/imfs_support/fs_config.h | 10 ++++ testsuites/fstests/imfs_support/fs_support.c | 11 ++++ testsuites/fstests/mimfs_support/fs_config.h | 10 ++++ testsuites/fstests/mimfs_support/fs_support.c | 41 +++++++++++++ 8 files changed, 196 insertions(+) create mode 100644 testsuites/fstests/.cvsignore create mode 100644 testsuites/fstests/ChangeLog create mode 100644 testsuites/fstests/Makefile.am create mode 100644 testsuites/fstests/configure.ac create mode 100644 testsuites/fstests/imfs_support/fs_config.h create mode 100644 testsuites/fstests/imfs_support/fs_support.c create mode 100644 testsuites/fstests/mimfs_support/fs_config.h create mode 100644 testsuites/fstests/mimfs_support/fs_support.c (limited to 'testsuites') 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 + + 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 ]]) + +# FIXME: newlib should supply declaration of pthread_atfork() +AC_CHECK_DECLS([pthread_atfork],[],[],[[#include ]]) + +# FIXME: RTEMS presumes pthread_attr_getcputime to be IEEE Std 1003.1 +# Likely an anachronism in RTEMS. +AC_CHECK_DECLS([pthread_attr_getcputime],[],[],[[#include ]]) + +# FIXME: RTEMS presumes pthread_attr_getcputime to be IEEE Std 1003.1 +# Likely an anachronism in RTEMS. +AC_CHECK_DECLS([pthread_attr_getcputime],[],[],[[#include ]]) + +# FIXME: RTEMS presumes pthread_attr_setcputime to be IEEE Std 1003.1 +# Likely an anachronism in RTEMS. +AC_CHECK_DECLS([pthread_attr_setcputime],[],[],[[#include ]]) + +# Added to pthreads after initial revision. May not be in toolset +AC_CHECK_DECLS([pthread_attr_getstack],[],[],[[#include ]]) + +# Added to pthreads after initial revision. May not be in toolset +AC_CHECK_DECLS([pthread_attr_setstack],[],[],[[#include ]]) + +# Added to pthreads after initial revision. May not be in toolset +AC_CHECK_DECLS([pthread_attr_getguardsize],[],[],[[#include ]]) + +# Added to pthreads after initial revision. May not be in toolset +AC_CHECK_DECLS([pthread_attr_setguardsize],[],[],[[#include ]]) + +# FIXME: adjtime is a non-standardized BSD/Linux extension +# RTEMS should not rely on adjtime +AC_CHECK_DECLS([adjtime],[],[],[[#include ]]) + +# 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 ]]) + +# 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 ]) + +# 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 +#include + +#include "pmacros.h" +#include "fs_config.h" + +#include + +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 ); + +} -- cgit v1.2.3