[PATCH 03/19] tm07: Split some code into new spnotepad02.

Joel Sherrill joel.sherrill at oarcorp.com
Mon Mar 16 20:29:20 UTC 2015


Use of deprecated notepads in sp07 needs further work.

Updates #2305.
---
 testsuites/sptests/Makefile.am                 |  2 +-
 testsuites/sptests/configure.ac                |  1 +
 testsuites/sptests/sp07/init.c                 | 36 +++++++-------
 testsuites/sptests/sp07/sp07.scn               |  2 -
 testsuites/sptests/sp07/task1.c                |  5 ++
 testsuites/sptests/sp07/task2.c                |  5 ++
 testsuites/sptests/spnotepad02/Makefile.am     | 22 +++++++++
 testsuites/sptests/spnotepad02/init.c          | 65 ++++++++++++++++++++++++++
 testsuites/sptests/spnotepad02/spnotepad02.doc |  0
 testsuites/sptests/spnotepad02/spnotepad02.scn |  0
 10 files changed, 116 insertions(+), 22 deletions(-)
 create mode 100644 testsuites/sptests/spnotepad02/Makefile.am
 create mode 100644 testsuites/sptests/spnotepad02/init.c
 create mode 100644 testsuites/sptests/spnotepad02/spnotepad02.doc
 create mode 100644 testsuites/sptests/spnotepad02/spnotepad02.scn

diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index bcb9326..0d1e687 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -12,7 +12,7 @@ _SUBDIRS = \
     sp60      sp62 sp63 sp64 sp65 sp66 sp67 sp68 sp69 \
     sp70 sp71 sp72 sp73 sp74 sp75 sp76 sp77 sp2038 \
     spassoc01 spchain spclockget spcoverage spobjgetnext \
-    spnotepad01 spprintk spprivenv01 sprbtree01 spsize spstkalloc \
+    spnotepad01 spnotepad02 spprintk spprivenv01 sprbtree01 spsize spstkalloc \
     spstkalloc02 spthreadq01 spwatchdog spwkspace \
     sperror01 sperror02 sperror03 \
     spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index 9534b4e..eef901b 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -209,6 +209,7 @@ spmountmgr01/Makefile
 spmsgq_err01/Makefile
 spmsgq_err02/Makefile
 spnotepad01/Makefile
+spnotepad02/Makefile
 spnsext01/Makefile
 spobjgetnext/Makefile
 sppagesize/Makefile
diff --git a/testsuites/sptests/sp07/init.c b/testsuites/sptests/sp07/init.c
index c08c5c4..0211a94 100644
--- a/testsuites/sptests/sp07/init.c
+++ b/testsuites/sptests/sp07/init.c
@@ -210,25 +210,23 @@ rtems_task Init(
   directive_failed( status, "rtems_task_restart of TA3" );
   assert_extension_counts( &Task_restarted[ 0 ], 0x0 );
 
-  status = rtems_task_set_note( rtems_task_self(), RTEMS_NOTEPAD_4, 32 );
-  directive_failed( status, "task_set_node of Self id" );
-  printf( "INIT - rtems_task_set_note - set my (id) RTEMS_NOTEPAD_4 " );
-  puts  ( "to TA1's priority: 04" );
-
-  status = rtems_task_set_note( RTEMS_SELF, RTEMS_NOTEPAD_4, 32 );
-  directive_failed( status, "task_set_node of Self 0" );
-  printf( "INIT - rtems_task_set_note - set my (SELF) RTEMS_NOTEPAD_4 " );
-  puts  ( "to TA1's priority: 04" );
-
-  status = rtems_task_set_note( Task_id[ 1 ], RTEMS_NOTEPAD_8, 4 );
-  directive_failed( status, "task_set_node of TA1" );
-  printf( "INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 " );
-  puts  ( "to TA1's priority: 04" );
-
-  status = rtems_task_set_note( Task_id[ 2 ], RTEMS_NOTEPAD_8, 4 );
-  directive_failed( status, "task_set_node of TA2" );
-  printf( "INIT - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8 " );
-  puts  ( "to TA2's priority: 04");
+ /*
+  * We know this is deprecated and don't want a warning on every BSP built.
+  */
+  #pragma GCC diagnostic push
+  #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
+    status = rtems_task_set_note( Task_id[ 1 ], RTEMS_NOTEPAD_8, 4 );
+    directive_failed( status, "task_set_node of TA1" );
+    printf( "INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 " );
+    puts  ( "to TA1's priority: 04" );
+
+    status = rtems_task_set_note( Task_id[ 2 ], RTEMS_NOTEPAD_8, 4 );
+    directive_failed( status, "task_set_node of TA2" );
+    printf( "INIT - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8 " );
+    puts  ( "to TA2's priority: 04");
+
+  #pragma GCC diagnostic pop
 
   status = rtems_task_delete( RTEMS_SELF );
   directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
diff --git a/testsuites/sptests/sp07/sp07.scn b/testsuites/sptests/sp07/sp07.scn
index 0fe6f29..77a9b24 100644
--- a/testsuites/sptests/sp07/sp07.scn
+++ b/testsuites/sptests/sp07/sp07.scn
@@ -10,8 +10,6 @@ rtems_extension_ident -- OK
 rtems_extension_ident - bad name -- RTEMS_INVALID_NAME
 rtems_extension_ident - bad name -- RTEMS_INVALID_ADDRESS
 rtems_extension_create - harmless -- OK
-INIT - rtems_task_set_note - set my (id) RTEMS_NOTEPAD_4 to TA1's priority: 04
-INIT - rtems_task_set_note - set my (SELF) RTEMS_NOTEPAD_4 to TA1's priority: 04
 INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 to TA1's priority: 04
 INIT - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8 to TA2's priority: 04
 <pause>
diff --git a/testsuites/sptests/sp07/task1.c b/testsuites/sptests/sp07/task1.c
index 15bc7a1..18c6375 100644
--- a/testsuites/sptests/sp07/task1.c
+++ b/testsuites/sptests/sp07/task1.c
@@ -13,6 +13,11 @@
 
 #include "system.h"
 
+/*
+ * We know this is deprecated and don't want a warning on every BSP built.
+ */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 rtems_task Task_1(
   rtems_task_argument argument
 )
diff --git a/testsuites/sptests/sp07/task2.c b/testsuites/sptests/sp07/task2.c
index 6451fff..11165ee 100644
--- a/testsuites/sptests/sp07/task2.c
+++ b/testsuites/sptests/sp07/task2.c
@@ -13,6 +13,11 @@
 
 #include "system.h"
 
+/*
+ * We know this is deprecated and don't want a warning on every BSP built.
+ */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 rtems_task Task_2(
   rtems_task_argument argument
 )
diff --git a/testsuites/sptests/spnotepad02/Makefile.am b/testsuites/sptests/spnotepad02/Makefile.am
new file mode 100644
index 0000000..943afce
--- /dev/null
+++ b/testsuites/sptests/spnotepad02/Makefile.am
@@ -0,0 +1,22 @@
+
+rtems_tests_PROGRAMS = spnotepad02
+spnotepad02_SOURCES = init.c
+
+dist_rtems_tests_DATA = spnotepad02.scn
+dist_rtems_tests_DATA += spnotepad02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(spnotepad02_OBJECTS)
+LINK_LIBS = $(spnotepad02_LDLIBS)
+
+spnotepad02$(EXEEXT): $(spnotepad02_OBJECTS) $(spnotepad02_DEPENDENCIES)
+	@rm -f spnotepad02$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spnotepad02/init.c b/testsuites/sptests/spnotepad02/init.c
new file mode 100644
index 0000000..0c9ba6e
--- /dev/null
+++ b/testsuites/sptests/spnotepad02/init.c
@@ -0,0 +1,65 @@
+/*
+ *  COPYRIGHT (c) 1989-2015.
+ *  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.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "tmacros.h"
+
+const char rtems_test_name[] = "SPNOTEPAD 2";
+
+/*
+ * We know this is deprecated and don't want a warning on every BSP built.
+ */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
+/* forward declarations to avoid warnings */
+rtems_task Init(rtems_task_argument argument);
+
+rtems_task Init(
+  rtems_task_argument ignored
+)
+{
+  rtems_status_code status;
+
+  TEST_BEGIN();
+
+  status = rtems_task_set_note( rtems_task_self(), RTEMS_NOTEPAD_4, 32 );
+  directive_failed( status, "task_set_node of Self id" );
+  printf( "INIT - rtems_task_set_note - set my (id) RTEMS_NOTEPAD_4 " );
+  puts  ( "to TA1's priority: 04" );
+
+  status = rtems_task_set_note( RTEMS_SELF, RTEMS_NOTEPAD_4, 32 );
+  directive_failed( status, "task_set_node of Self 0" );
+  printf( "INIT - rtems_task_set_note - set my (SELF) RTEMS_NOTEPAD_4 " );
+  puts  ( "to TA1's priority: 04" );
+
+
+  TEST_END();
+
+  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_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
+#define CONFIGURE_ENABLE_CLASSIC_API_NOTEPADS
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+
+/* global variables */
diff --git a/testsuites/sptests/spnotepad02/spnotepad02.doc b/testsuites/sptests/spnotepad02/spnotepad02.doc
new file mode 100644
index 0000000..e69de29
diff --git a/testsuites/sptests/spnotepad02/spnotepad02.scn b/testsuites/sptests/spnotepad02/spnotepad02.scn
new file mode 100644
index 0000000..e69de29
-- 
1.9.3




More information about the devel mailing list