[rtems commit] tests: Produce proper begin/end messages

Sebastian Huber sebh at rtems.org
Tue Mar 25 15:39:29 UTC 2014


Module:    rtems
Branch:    master
Commit:    8c26e79867739e13a8699883ec1fa86127d94aaf
Changeset: http://git.rtems.org/rtems/commit/?id=8c26e79867739e13a8699883ec1fa86127d94aaf

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Mar 25 16:45:08 2014 +0100

tests: Produce proper begin/end messages

---

 testsuites/libtests/tar02/init.c    |    1 -
 testsuites/psxtests/psx13/test.c    |    6 +++---
 testsuites/samples/iostream/init.cc |    5 +++--
 testsuites/sptests/sperror01/init.c |   23 +++++++++++++++++++----
 testsuites/sptests/sperror02/init.c |   22 ++++++++++++++++++----
 testsuites/sptests/sperror03/init.c |   22 ++++++++++++++++++----
 6 files changed, 61 insertions(+), 18 deletions(-)

diff --git a/testsuites/libtests/tar02/init.c b/testsuites/libtests/tar02/init.c
index d958165..cfeda1b 100644
--- a/testsuites/libtests/tar02/init.c
+++ b/testsuites/libtests/tar02/init.c
@@ -57,7 +57,6 @@ void test_tarfs_load(void)
   test_cat( "/home/test_file", 0, 0 );
   
   /******************/
-  TEST_BEGIN();
 #if 0
   printf( "========= /symlink =========\n" );
   test_cat( "/symlink", 0, 0 );
diff --git a/testsuites/psxtests/psx13/test.c b/testsuites/psxtests/psx13/test.c
index c039bff..fc50463 100644
--- a/testsuites/psxtests/psx13/test.c
+++ b/testsuites/psxtests/psx13/test.c
@@ -716,10 +716,10 @@ int main(
 
     printf ("Testing sync()...... ");
     sync();
+    printf ("Done.\n");
+
+    TEST_END();
   }
-  else
-    TEST_BEGIN();
 
-  TEST_END();
   rtems_test_exit(0);
 }
diff --git a/testsuites/samples/iostream/init.cc b/testsuites/samples/iostream/init.cc
index 5133a8d..610e73f 100644
--- a/testsuites/samples/iostream/init.cc
+++ b/testsuites/samples/iostream/init.cc
@@ -29,7 +29,7 @@
 
 #include <stdlib.h>
 
-const char rtems_test_name[] = "HELLO WORLD";
+const char rtems_test_name[] = "IOSTREAM";
 
 rtems_task Init(
   rtems_task_argument ignored
@@ -38,7 +38,8 @@ rtems_task Init(
 #if BSP_SMALL_MEMORY
   printf ("NO STDC++. MEMORY TOO SMALL");
 #else
-  std::cout << "\n\n*** " << rtems_test_name << " TEST ***" << std::endl;
+  std::cout << std::endl << std::endl
+    << "*** BEGIN OF " << rtems_test_name << " TEST ***" << std::endl;
   std::cout << "Hello World" << std::endl;
   std::cout << "*** END OF " << rtems_test_name << " TEST ***" << std::endl;
 #endif
diff --git a/testsuites/sptests/sperror01/init.c b/testsuites/sptests/sperror01/init.c
index 1f3e3f9..4c40be5 100644
--- a/testsuites/sptests/sperror01/init.c
+++ b/testsuites/sptests/sperror01/init.c
@@ -21,6 +21,21 @@ const char rtems_test_name[] = "SPERROR 1";
 /* forward declarations to avoid warnings */
 rtems_task Init(rtems_task_argument argument);
 
+static void fatal_extension(
+  rtems_fatal_source source,
+  bool is_internal,
+  rtems_fatal_code error
+)
+{
+  if (
+    source == RTEMS_FATAL_SOURCE_EXIT
+      && !is_internal
+      && error == ENOMEM
+  ) {
+    rtems_test_endk();
+  }
+}
+
 rtems_task Init(
   rtems_task_argument argument
 )
@@ -41,10 +56,9 @@ rtems_task Init(
   rtems_error(
     RTEMS_NO_MEMORY | RTEMS_ERROR_PANIC,
     "Dummy: Resources unavailable\n"
-    "*** END OF TEST Tests for error reporting routines - 01 ***\n"
   );
-  
-  rtems_test_exit(0);
+
+  rtems_test_assert(0);
 }
 
 /* configuration information */
@@ -53,7 +67,8 @@ rtems_task Init(
 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
 
 #define CONFIGURE_MAXIMUM_TASKS             1
-#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
+#define CONFIGURE_INITIAL_EXTENSIONS \
+  { .fatal = fatal_extension }, RTEMS_TEST_INITIAL_EXTENSION
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
diff --git a/testsuites/sptests/sperror02/init.c b/testsuites/sptests/sperror02/init.c
index d4f74f5..dca2219 100644
--- a/testsuites/sptests/sperror02/init.c
+++ b/testsuites/sptests/sperror02/init.c
@@ -21,6 +21,21 @@ const char rtems_test_name[] = "SPERROR 2";
 /* forward declarations to avoid warnings */
 rtems_task Init(rtems_task_argument argument);
 
+static void fatal_extension(
+  rtems_fatal_source source,
+  bool is_internal,
+  rtems_fatal_code error
+)
+{
+  if (
+    source == RTEMS_FATAL_SOURCE_EXIT
+      && !is_internal
+      && error == 1
+  ) {
+    rtems_test_endk();
+  }
+}
+
 rtems_task Init(
   rtems_task_argument argument
 )
@@ -31,11 +46,9 @@ rtems_task Init(
   rtems_error(
     RTEMS_NO_MEMORY | RTEMS_ERROR_ABORT, 
     "Dummy: Resources unavailable\n"
-    "*** END OF TEST Tests for error reporting routines - 02 ***\n"
   );
-  
 
-  rtems_test_exit(0);
+  rtems_test_assert(0);
 }
 
 /* configuration information */
@@ -44,7 +57,8 @@ rtems_task Init(
 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
 
 #define CONFIGURE_MAXIMUM_TASKS             1
-#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
+#define CONFIGURE_INITIAL_EXTENSIONS \
+  { .fatal = fatal_extension }, RTEMS_TEST_INITIAL_EXTENSION
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
diff --git a/testsuites/sptests/sperror03/init.c b/testsuites/sptests/sperror03/init.c
index 61b405d..818b907 100644
--- a/testsuites/sptests/sperror03/init.c
+++ b/testsuites/sptests/sperror03/init.c
@@ -19,6 +19,21 @@ const char rtems_test_name[] = "SPERROR 3";
 /* forward declarations to avoid warnings */
 rtems_task Init(rtems_task_argument argument);
 
+static void fatal_extension(
+  rtems_fatal_source source,
+  bool is_internal,
+  rtems_fatal_code error
+)
+{
+  if (
+    source == RTEMS_FATAL_SOURCE_EXIT
+      && !is_internal
+      && error == 0
+  ) {
+    rtems_test_endk();
+  }
+}
+
 rtems_task Init(
   rtems_task_argument argument
 )
@@ -27,11 +42,9 @@ rtems_task Init(
 
   rtems_panic(
     "Dummy panic\n"
-    "*** END OF TEST Tests for error reporting routines - 03 ***\n"
   );
-  
 
-  rtems_test_exit(0);
+  rtems_test_assert(0);
 }
 
 /* configuration information */
@@ -40,7 +53,8 @@ rtems_task Init(
 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
 
 #define CONFIGURE_MAXIMUM_TASKS             1
-#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
+#define CONFIGURE_INITIAL_EXTENSIONS \
+  { .fatal = fatal_extension }, RTEMS_TEST_INITIAL_EXTENSION
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 




More information about the vc mailing list