diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-10 17:04:50 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-10 17:04:50 +0000 |
commit | 7c11edfd82f9048ef58984e62280f35cc8ae3794 (patch) | |
tree | e375e4fb044e8da20a6f7b50b30c65abd4544feb /testsuites/sptests/spclockget | |
parent | 2009-08-10 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-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/sptests/spclockget')
-rw-r--r-- | testsuites/sptests/spclockget/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/sptests/spclockget/Makefile.am | 28 | ||||
-rw-r--r-- | testsuites/sptests/spclockget/init.c | 65 | ||||
-rw-r--r-- | testsuites/sptests/spclockget/spclockget.doc | 22 | ||||
-rw-r--r-- | testsuites/sptests/spclockget/spclockget.scn | 8 |
5 files changed, 125 insertions, 0 deletions
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 *** |