summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-10 17:04:50 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-10 17:04:50 +0000
commit7c11edfd82f9048ef58984e62280f35cc8ae3794 (patch)
treee375e4fb044e8da20a6f7b50b30c65abd4544feb /testsuites
parent2009-08-10 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-7c11edfd82f9048ef58984e62280f35cc8ae3794.tar.bz2
2009-08-10 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add new test to exercise legacy rtems_clock_get(). * spclockget/.cvsignore, spclockget/Makefile.am, spclockget/init.c, spclockget/spclockget.doc, spclockget/spclockget.scn: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/ChangeLog7
-rw-r--r--testsuites/sptests/Makefile.am2
-rw-r--r--testsuites/sptests/configure.ac1
-rw-r--r--testsuites/sptests/spclockget/.cvsignore2
-rw-r--r--testsuites/sptests/spclockget/Makefile.am28
-rw-r--r--testsuites/sptests/spclockget/init.c65
-rw-r--r--testsuites/sptests/spclockget/spclockget.doc22
-rw-r--r--testsuites/sptests/spclockget/spclockget.scn8
8 files changed, 134 insertions, 1 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index 237cbffdbb..afc876899a 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-10 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * Makefile.am, configure.ac: Add new test to exercise legacy
+ rtems_clock_get().
+ * spclockget/.cvsignore, spclockget/Makefile.am, spclockget/init.c,
+ spclockget/spclockget.doc, spclockget/spclockget.scn: New files.
+
2009-08-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp04/task1.c, sp09/screen02.c, sp09/screen04.c, sp09/sp09.scn,
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 0c85147b5f..e5c1fef327 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -14,7 +14,7 @@ SUBDIRS = \
sp40 sp41 sp42 sp43 sp44 sp45 sp46 sp47 sp48 sp49 \
sp50 sp51 sp52 sp53 sp54 sp55 sp56 sp57 sp58 sp59 \
sp60 sp61 sp62 sp63 sp64 \
- spchain spobjgetnext spprintk spsize spstkalloc spthreadq01 \
+ spchain spclockget spobjgetnext spprintk spsize spstkalloc spthreadq01 \
spwatchdog spwkspace \
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
spfatal08 spfatal09 spfatal10 spfatal11 spfatal12 \
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index 2d004e2e56..524ff966ec 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -92,6 +92,7 @@ sp62/Makefile
sp63/Makefile
sp64/Makefile
spchain/Makefile
+spclockget/Makefile
spfatal01/Makefile
spfatal02/Makefile
spfatal03/Makefile
diff --git a/testsuites/sptests/spclockget/.cvsignore b/testsuites/sptests/spclockget/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/spclockget/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/spclockget/Makefile.am b/testsuites/sptests/spclockget/Makefile.am
new file mode 100644
index 0000000000..7dc662a291
--- /dev/null
+++ b/testsuites/sptests/spclockget/Makefile.am
@@ -0,0 +1,28 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = spclockget
+spclockget_SOURCES = init.c
+
+dist_rtems_tests_DATA = spclockget.scn
+dist_rtems_tests_DATA += spclockget.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+spclockget_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(spclockget_OBJECTS) $(spclockget_LDADD)
+LINK_LIBS = $(spclockget_LDLIBS)
+
+spclockget$(EXEEXT): $(spclockget_OBJECTS) $(spclockget_DEPENDENCIES)
+ @rm -f spclockget$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spclockget/init.c b/testsuites/sptests/spclockget/init.c
new file mode 100644
index 0000000000..f25ab1b618
--- /dev/null
+++ b/testsuites/sptests/spclockget/init.c
@@ -0,0 +1,65 @@
+/*
+ * COPYRIGHT (c) 1989-2009.
+ * 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$
+ */
+
+#include <tmacros.h>
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ rtems_status_code sc;
+ rtems_time_of_day time;
+ rtems_interval interval;
+ struct timeval timev;
+
+ puts( "\n\n*** TEST LEGACY RTEMS_CLOCK_GET ***" );
+
+ puts( "Init - clock_set_time" );
+ build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
+ sc = rtems_clock_set( &time );
+ directive_failed( sc, "rtems_clock_set" );
+
+ sc = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( sc, "rtems_clock_get -- TOD" );
+ print_time( "Init - rtems_clock_get - ", &time, "\n" );
+
+ sc = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &interval );
+ directive_failed( sc, "rtems_clock_get -- Seconds Since Epoch" );
+ printf( "Init - rtems_clock_get - Seconds Since Epoch = %d\n", interval );
+
+ sc = rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &interval );
+ directive_failed( sc, "rtems_clock_get -- Ticks Since Boot" );
+ printf( "Init - rtems_clock_get - Ticks Since Boot = %d\n", interval );
+
+ sc = rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &interval );
+ directive_failed( sc, "rtems_clock_get -- Ticks Per Second" );
+ printf( "Init - rtems_clock_get - Ticks Per Second = %d\n", interval );
+
+ sc = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &timev );
+ directive_failed( sc, "rtems_clock_get -- Time Value" );
+ printf( "Init - rtems_clock_get - Time Value = %d\n", timev.tv_sec );
+
+ puts( "*** END OF TEST LEGACY RTEMS_CLOCK_GET ***" );
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
+/* global variables */
diff --git a/testsuites/sptests/spclockget/spclockget.doc b/testsuites/sptests/spclockget/spclockget.doc
new file mode 100644
index 0000000000..09e5ffdc51
--- /dev/null
+++ b/testsuites/sptests/spclockget/spclockget.doc
@@ -0,0 +1,22 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2009.
+# 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.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: spclockget
+
+directives:
+
+ rtems_clock_get() - LEGACY
+
+concepts:
+
++ Exercise the legacy rtems_clock_get() method.
diff --git a/testsuites/sptests/spclockget/spclockget.scn b/testsuites/sptests/spclockget/spclockget.scn
new file mode 100644
index 0000000000..ce0d73f93a
--- /dev/null
+++ b/testsuites/sptests/spclockget/spclockget.scn
@@ -0,0 +1,8 @@
+*** TEST LEGACY RTEMS_CLOCK_GET ***
+Init - clock_set_time
+Init - rtems_clock_get - 09:00:00 12/31/1988
+Init - rtems_clock_get - Seconds Since Epoch = 599562000
+Init - rtems_clock_get - Ticks Since Boot = 0
+Init - rtems_clock_get - Ticks Per Second = 100
+Init - rtems_clock_get - Time Value = 599562000
+*** END OF TEST LEGACY RTEMS_CLOCK_GET ***