summaryrefslogtreecommitdiff
path: root/rtems-test-template
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-21 18:26:06 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-21 18:26:06 +0000
commit682c20c75a3698ab8e5b492f422f636d17e42606 (patch)
tree52adf9da49c846936b662c101b5700a4f8814298 /rtems-test-template
parentd5f452dda71c9336279093dd014e30b06f18b923 (diff)
2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* sptest_operation_from_tsr/Makefile.am, sptest_operation_from_tsr/TEST.doc, sptest_operation_from_tsr/TEST.scn, sptest_operation_from_tsr/init.c: New files.
Diffstat (limited to 'rtems-test-template')
-rw-r--r--rtems-test-template/ChangeLog7
-rw-r--r--rtems-test-template/sptest_operation_from_tsr/Makefile.am26
-rw-r--r--rtems-test-template/sptest_operation_from_tsr/TEST.doc22
-rw-r--r--rtems-test-template/sptest_operation_from_tsr/TEST.scn1
-rw-r--r--rtems-test-template/sptest_operation_from_tsr/init.c87
5 files changed, 143 insertions, 0 deletions
diff --git a/rtems-test-template/ChangeLog b/rtems-test-template/ChangeLog
index 6087ea0..442d6a3 100644
--- a/rtems-test-template/ChangeLog
+++ b/rtems-test-template/ChangeLog
@@ -1,5 +1,12 @@
2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
+ * sptest_operation_from_tsr/Makefile.am,
+ sptest_operation_from_tsr/TEST.doc,
+ sptest_operation_from_tsr/TEST.scn, sptest_operation_from_tsr/init.c:
+ New files.
+
+2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
+
* tmtest/Makefile.am, tmtest/TEST.doc, tmtest/init.c: New files.
2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
diff --git a/rtems-test-template/sptest_operation_from_tsr/Makefile.am b/rtems-test-template/sptest_operation_from_tsr/Makefile.am
new file mode 100644
index 0000000..0f35215
--- /dev/null
+++ b/rtems-test-template/sptest_operation_from_tsr/Makefile.am
@@ -0,0 +1,26 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = @LOWER@
+@LOWER@_SOURCES = init.c ../../support/src/spin.c
+
+dist_rtems_tests_DATA = @LOWER@.scn
+dist_rtems_tests_DATA += @LOWER@.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(@LOWER@_OBJECTS) $(@LOWER@_LDADD)
+LINK_LIBS = $(@LOWER@_LDLIBS)
+
+@LOWER@$(EXEEXT): $(@LOWER@_OBJECTS) $(@LOWER@_DEPENDENCIES)
+ @rm -f @LOWER@$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/rtems-test-template/sptest_operation_from_tsr/TEST.doc b/rtems-test-template/sptest_operation_from_tsr/TEST.doc
new file mode 100644
index 0000000..5c5378c
--- /dev/null
+++ b/rtems-test-template/sptest_operation_from_tsr/TEST.doc
@@ -0,0 +1,22 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2010.
+# 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: @LOWER@
+
+directives:
+
+ XXX list them
+
+concepts:
+
++ XXX list them
diff --git a/rtems-test-template/sptest_operation_from_tsr/TEST.scn b/rtems-test-template/sptest_operation_from_tsr/TEST.scn
new file mode 100644
index 0000000..a636120
--- /dev/null
+++ b/rtems-test-template/sptest_operation_from_tsr/TEST.scn
@@ -0,0 +1 @@
+XXX fill in with test output
diff --git a/rtems-test-template/sptest_operation_from_tsr/init.c b/rtems-test-template/sptest_operation_from_tsr/init.c
new file mode 100644
index 0000000..fef2ad5
--- /dev/null
+++ b/rtems-test-template/sptest_operation_from_tsr/init.c
@@ -0,0 +1,87 @@
+/*
+ * 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>
+
+volatile bool operation_performed_from_tsr;
+
+rtems_timer_service_routine test_operation_from_isr(
+ rtems_id timer,
+ void *arg
+)
+{
+ /* do something from ISR */
+
+
+ operation_performed_from_tsr = true;
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_id timer;
+
+ puts( "\n\n*** TEST @DESC@ ***" );
+
+ /*
+ * Timer used in multiple ways
+ */
+ status = rtems_timer_create( rtems_build_name('T', 'M', 'R', '0'), &timer );
+ directive_failed( status, "rtems_timer_create" );
+
+ operation_performed_from_tsr = false;
+
+ /*
+ * Test Operation from ISR
+ */
+ status = rtems_timer_fire_after( timer, 10, test_operation_from_isr, NULL );
+ directive_failed( status, "timer_fire_after failed" );
+
+ /* XXX pick a delay method */
+#if 0
+ status = rtems_task_wake_after( 20 );
+#else
+ {
+ rtems_interval start;
+ rtems_interval now;
+ start = rtems_clock_get_ticks_since_boot();
+ do {
+ now = rtems_clock_get_ticks_since_boot();
+ } while ( (now-start) > 100 );
+ }
+#endif
+ if ( !operation_performed_from_tsr ) {
+ puts( "Operation from ISR did not get processed\n" );
+ rtems_test_exit( 0 );
+ }
+
+ /* XXX also may be able to confirm operation actually was performed */
+
+ puts( "*** END OF TEST @DESC@ ***" );
+ rtems_test_exit( 0 );
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MAXIMUM_TIMERS 1
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+/* end of file */
+