summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp10
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-21 19:32:30 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-21 19:32:30 +0000
commitbd894e544719b754168b48a0551553e4ac79fabd (patch)
treec4cfa00c550c42d83422aab7dcbc828345b4db6d /testsuites/sptests/sp10
parent2009-07-21 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-bd894e544719b754168b48a0551553e4ac79fabd.tar.bz2
2009-07-21 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add new test to exercise Debug Manager. * sp10/.cvsignore, sp10/Makefile.am, sp10/init.c, sp10/sp10.doc, sp10/sp10.scn: New files.
Diffstat (limited to 'testsuites/sptests/sp10')
-rw-r--r--testsuites/sptests/sp10/.cvsignore2
-rw-r--r--testsuites/sptests/sp10/Makefile.am28
-rw-r--r--testsuites/sptests/sp10/init.c61
-rw-r--r--testsuites/sptests/sp10/sp10.doc24
-rw-r--r--testsuites/sptests/sp10/sp10.scn8
5 files changed, 123 insertions, 0 deletions
diff --git a/testsuites/sptests/sp10/.cvsignore b/testsuites/sptests/sp10/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/sp10/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/sp10/Makefile.am b/testsuites/sptests/sp10/Makefile.am
new file mode 100644
index 0000000000..c5fba4d46a
--- /dev/null
+++ b/testsuites/sptests/sp10/Makefile.am
@@ -0,0 +1,28 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = sp10
+sp10_SOURCES = init.c
+
+dist_rtems_tests_DATA = sp10.scn
+dist_rtems_tests_DATA += sp10.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+sp10_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(sp10_OBJECTS) $(sp10_LDADD)
+LINK_LIBS = $(sp10_LDLIBS)
+
+sp10$(EXEEXT): $(sp10_OBJECTS) $(sp10_DEPENDENCIES)
+ @rm -f sp10$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/sp10/init.c b/testsuites/sptests/sp10/init.c
new file mode 100644
index 0000000000..5ca4a450fc
--- /dev/null
+++ b/testsuites/sptests/sp10/init.c
@@ -0,0 +1,61 @@
+/*
+ * 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;
+ bool is_set;
+
+ puts( "\n\n*** TEST 10 ***" );
+
+ puts( "Init - clear debug level" );
+ _Debug_Level = 0;
+
+ puts( "Init - rtems_debug_is_enabled - is 0x1 set? No" );
+ is_set = rtems_debug_is_enabled( 0x1 );
+ rtems_test_assert(is_set == false);
+
+ puts( "Init - rtems_debug_enable - set 0x1" );
+ rtems_debug_enable(0x1);
+ rtems_test_assert(_Debug_Level == 0x1);
+
+ puts( "Init - rtems_debug_is_enabled - is 0x1 set? Yes" );
+ is_set = rtems_debug_is_enabled( 0x1 );
+ rtems_test_assert(is_set == true);
+
+ puts( "Init - rtems_debug_disable - clear 0x1" );
+ rtems_debug_disable(0x1);
+ rtems_test_assert(_Debug_Level == 0x0);
+
+ puts( "Init - rtems_debug_is_enabled - is 0x1 set? No" );
+ is_set = rtems_debug_is_enabled( 0x1 );
+ rtems_test_assert(is_set == false);
+
+ puts( "*** END OF TEST 10 ***" );
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_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/sp10/sp10.doc b/testsuites/sptests/sp10/sp10.doc
new file mode 100644
index 0000000000..c9f9545ebe
--- /dev/null
+++ b/testsuites/sptests/sp10/sp10.doc
@@ -0,0 +1,24 @@
+#
+# $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: sp10
+
+directives:
+
+ rtems_debug_enable
+ rtems_debug_disable
+ rtems_debug_is_enabled
+
+concepts:
+
++ Exercise the Debug Manager.
diff --git a/testsuites/sptests/sp10/sp10.scn b/testsuites/sptests/sp10/sp10.scn
new file mode 100644
index 0000000000..368743407f
--- /dev/null
+++ b/testsuites/sptests/sp10/sp10.scn
@@ -0,0 +1,8 @@
+*** TEST 10 ***
+Init - clear debug level
+Init - rtems_debug_is_enabled - is 0x1 set? No
+Init - rtems_debug_enable - set 0x1
+Init - rtems_debug_is_enabled - is 0x1 set? Yes
+Init - rtems_debug_disable - clear 0x1
+Init - rtems_debug_is_enabled - is 0x1 set? No
+*** END OF TEST 10 ***