summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2011-05-06 07:08:04 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2011-05-06 07:08:04 +0000
commitb68d231ee23e5d1a0e38e03d34ce5af3c5cfd5f8 (patch)
tree4ba3d4d9a03dfbae93f077ccff92064f7389f745 /testsuites
parent2011-05-05 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-b68d231ee23e5d1a0e38e03d34ce5af3c5cfd5f8.tar.bz2
2011-05-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
* spnsext01/.cvsignore, spnsext01/Makefile.am, spnsext01/init.c, spnsext01/spnsext01.doc, spnsext01/spnsext01.scn: New files. * Makefile.am, configure.ac: Reflect changes above.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/ChangeLog6
-rw-r--r--testsuites/sptests/Makefile.am2
-rw-r--r--testsuites/sptests/configure.ac1
-rw-r--r--testsuites/sptests/spnsext01/.cvsignore2
-rw-r--r--testsuites/sptests/spnsext01/Makefile.am27
-rw-r--r--testsuites/sptests/spnsext01/init.c88
-rw-r--r--testsuites/sptests/spnsext01/spnsext01.doc27
-rw-r--r--testsuites/sptests/spnsext01/spnsext01.scn2
8 files changed, 154 insertions, 1 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index 5052c35601..737cebe4fb 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * spnsext01/.cvsignore, spnsext01/Makefile.am, spnsext01/init.c,
+ spnsext01/spnsext01.doc, spnsext01/spnsext01.scn: New files.
+ * Makefile.am, configure.ac: Reflect changes above.
+
2011-05-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp09/screen12.c, sp09/sp09.scn, sp21/Makefile.am, sp35/priinv.c,
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index c61c975b5f..7307c7378a 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -29,7 +29,7 @@ SUBDIRS = \
spintrcritical09 spintrcritical10 spintrcritical11 spintrcritical12 \
spintrcritical13 spintrcritical14 spintrcritical15 spintrcritical16 \
spintrcritical17 spmkdir spmountmgr01 spheapprot \
- spsimplesched01 spsimplesched02 spsimplesched03
+ spsimplesched01 spsimplesched02 spsimplesched03 spnsext01
DIST_SUBDIRS = $(SUBDIRS) spfatal_support spintrcritical_support
EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index fff03defdd..7ba1a8c025 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -157,6 +157,7 @@ spheapprot/Makefile
spmkdir/Makefile
spmountmgr01/Makefile
spnotepad01/Makefile
+spnsext01/Makefile
spobjgetnext/Makefile
spprintk/Makefile
spprivenv01/Makefile
diff --git a/testsuites/sptests/spnsext01/.cvsignore b/testsuites/sptests/spnsext01/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/spnsext01/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/spnsext01/Makefile.am b/testsuites/sptests/spnsext01/Makefile.am
new file mode 100644
index 0000000000..7abbcb73d1
--- /dev/null
+++ b/testsuites/sptests/spnsext01/Makefile.am
@@ -0,0 +1,27 @@
+##
+## $Id$
+##
+
+MANAGERS = io semaphore event
+
+rtems_tests_PROGRAMS = spnsext01
+spnsext01_SOURCES = init.c
+
+dist_rtems_tests_DATA = spnsext01.scn spnsext01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+spnsext01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(spnsext01_OBJECTS) $(spnsext01_LDADD)
+LINK_LIBS = $(spnsext01_LDLIBS)
+
+spnsext01$(EXEEXT): $(spnsext01_OBJECTS) $(spnsext01_DEPENDENCIES)
+ @rm -f spnsext01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spnsext01/init.c b/testsuites/sptests/spnsext01/init.c
new file mode 100644
index 0000000000..7520b0648d
--- /dev/null
+++ b/testsuites/sptests/spnsext01/init.c
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2011 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tmacros.h>
+
+static rtems_task Init(rtems_task_argument argument)
+{
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ rtems_interrupt_level level;
+ rtems_interval t0 = 0;
+ rtems_interval t1 = 0;
+ int i = 0;
+ int n = 0;
+ struct timespec uptime;
+ struct timespec new_uptime;
+
+ puts("\n\n*** TEST NANO SECONDS EXTENSION 1 ***");
+
+ /* Align with clock tick */
+ t0 = rtems_clock_get_ticks_since_boot();
+ while ((t1 = rtems_clock_get_ticks_since_boot()) == t0) {
+ /* Do nothing */
+ }
+
+ t0 = t1;
+ sc = rtems_clock_get_uptime(&uptime);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+ while ((t1 = rtems_clock_get_ticks_since_boot()) == t0) {
+ ++n;
+ sc = rtems_clock_get_uptime(&new_uptime);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+ rtems_test_assert(!_Timestamp_Less_than(&new_uptime, &uptime));
+ uptime = new_uptime;
+ }
+
+ n = (3 * n) / 2;
+
+ rtems_interrupt_disable(level);
+ sc = rtems_clock_get_uptime(&uptime);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+ for (i = 0; i < n; ++i) {
+ /* Preserve execution time of previous loop */
+ rtems_clock_get_ticks_since_boot();
+
+ sc = rtems_clock_get_uptime(&new_uptime);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+ rtems_test_assert(!_Timestamp_Less_than(&new_uptime, &uptime));
+ uptime = new_uptime;
+ }
+ rtems_interrupt_enable(level);
+
+ puts("*** END OF TEST NANO SECONDS EXTENSION 1 ***");
+
+ rtems_test_exit(0);
+}
+
+#define CONFIGURE_INIT
+
+#define CONFIGURE_MICROSECONDS_PER_TICK 100000
+
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MAXIMUM_DRIVERS 2
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#include <rtems/confdefs.h>
diff --git a/testsuites/sptests/spnsext01/spnsext01.doc b/testsuites/sptests/spnsext01/spnsext01.doc
new file mode 100644
index 0000000000..c35f4a5c17
--- /dev/null
+++ b/testsuites/sptests/spnsext01/spnsext01.doc
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2011 embedded brains GmbH. All rights reserved.
+#
+# embedded brains GmbH
+# Obere Lagerstr. 30
+# 82178 Puchheim
+# Germany
+# <rtems@embedded-brains.de>
+#
+# 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$
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: spnsext
+
+directives:
+
+ rtems_clock_get_uptime
+
+concepts:
+
++ Check if nano seconds extension works.
diff --git a/testsuites/sptests/spnsext01/spnsext01.scn b/testsuites/sptests/spnsext01/spnsext01.scn
new file mode 100644
index 0000000000..bb64f82d76
--- /dev/null
+++ b/testsuites/sptests/spnsext01/spnsext01.scn
@@ -0,0 +1,2 @@
+*** TEST NANO SECONDS EXTENSION 1 ***
+*** END OF TEST NANO SECONDS EXTENSION 1 ***