Index: testsuites/psxtests/psxintrcritical01/init.c
===================================================================
--- testsuites/psxtests/psxintrcritical01/init.c	(revision 857a65dc7ed8987f5fc72f23ebcf7eba65070362)
+++ testsuites/psxtests/psxintrcritical01/init.c	(revision 21f733397903db061c17185a17fcee95e38ee21f)
@@ -18,5 +18,5 @@
 
 #include <rtems/test.h>
-#include <rtems/simple-test.h>
+#include <rtems/test-info.h>
 
 const char rtems_test_name[] = "PSXINTRCRITICAL 1";
@@ -54,7 +54,5 @@
   T_quiet_psx_success(rv);
 
-  while (T_interrupt_test_get_state() == T_INTERRUPT_TEST_ACTION) {
-    /* Wait */
-  }
+  T_interrupt_test_busy_wait_for_interrupt();
 }
 
@@ -62,10 +60,7 @@
 {
   test_context *ctx;
-  T_interrupt_test_state state;
   int rv;
 
-  state = T_interrupt_test_get_state();
-
-  if (state != T_INTERRUPT_TEST_ACTION) {
+  if (T_interrupt_test_get_state() != T_INTERRUPT_TEST_ACTION) {
     return T_INTERRUPT_TEST_EARLY;
   }
Index: testsuites/sptests/Makefile.am
===================================================================
--- testsuites/sptests/Makefile.am	(revision 857a65dc7ed8987f5fc72f23ebcf7eba65070362)
+++ testsuites/sptests/Makefile.am	(revision 21f733397903db061c17185a17fcee95e38ee21f)
@@ -1191,7 +1191,5 @@
 sp_screens += spintrcritical01/spintrcritical01.scn
 sp_docs += spintrcritical01/spintrcritical01.doc
-spintrcritical01_SOURCES = spintrcritical01/init.c \
-	spintrcritical_support/intrcritical.c \
-	spintrcritical_support/intrcritical.h
+spintrcritical01_SOURCES = spintrcritical01/init.c
 spintrcritical01_CPPFLAGS = $(AM_CPPFLAGS) \
 	$(TEST_FLAGS_spintrcritical01) $(support_includes) \
@@ -1203,6 +1201,5 @@
 sp_screens += spintrcritical02/spintrcritical02.scn
 sp_docs += spintrcritical02/spintrcritical02.doc
-spintrcritical02_SOURCES = spintrcritical02/init.c \
-	spintrcritical_support/intrcritical.c
+spintrcritical02_SOURCES = spintrcritical02/init.c
 spintrcritical02_CPPFLAGS = $(AM_CPPFLAGS) \
 	$(TEST_FLAGS_spintrcritical02) $(support_includes) \
@@ -1214,6 +1211,5 @@
 sp_screens += spintrcritical03/spintrcritical03.scn
 sp_docs += spintrcritical03/spintrcritical03.doc
-spintrcritical03_SOURCES = spintrcritical03/init.c \
-	spintrcritical_support/intrcritical.c
+spintrcritical03_SOURCES = spintrcritical03/init.c
 spintrcritical03_CPPFLAGS = $(AM_CPPFLAGS) \
 	$(TEST_FLAGS_spintrcritical03) $(support_includes) \
@@ -1225,6 +1221,5 @@
 sp_screens += spintrcritical04/spintrcritical04.scn
 sp_docs += spintrcritical04/spintrcritical04.doc
-spintrcritical04_SOURCES = spintrcritical04/init.c \
-	spintrcritical_support/intrcritical.c
+spintrcritical04_SOURCES = spintrcritical04/init.c
 spintrcritical04_CPPFLAGS = $(AM_CPPFLAGS) \
 	$(TEST_FLAGS_spintrcritical04) $(support_includes) \
@@ -1236,6 +1231,5 @@
 sp_screens += spintrcritical05/spintrcritical05.scn
 sp_docs += spintrcritical05/spintrcritical05.doc
-spintrcritical05_SOURCES = spintrcritical05/init.c \
-	spintrcritical_support/intrcritical.c
+spintrcritical05_SOURCES = spintrcritical05/init.c
 spintrcritical05_CPPFLAGS = $(AM_CPPFLAGS) \
 	$(TEST_FLAGS_spintrcritical05) $(support_includes) \
Index: testsuites/sptests/spintrcritical01/spintrcritical01.scn
===================================================================
--- testsuites/sptests/spintrcritical01/spintrcritical01.scn	(revision 857a65dc7ed8987f5fc72f23ebcf7eba65070362)
+++ testsuites/sptests/spintrcritical01/spintrcritical01.scn	(revision 21f733397903db061c17185a17fcee95e38ee21f)
@@ -1,6 +1,24 @@
-*** TEST INTERRUPT CRITICAL SECTION 01 ***
-Init - Trying to generate semaphore release from ISR while blocking
-Init - Variation is: FIFO/Without Timeout
-Support - rtems_timer_create - creating timer 1
-Init - Case hit
-*** END OF TEST INTERRUPT CRITICAL SECTION 01 ***
+*** BEGIN OF TEST SPINTRCRITICAL 1 ***
+*** TEST VERSION: 6.0.0.929e49a54ab4d2d18c9fb8d03610614f63e25b8d
+*** TEST STATE: EXPECTED_PASS
+*** TEST BUILD: RTEMS_DEBUG RTEMS_POSIX_API RTEMS_SMP
+*** TEST TOOLS: 10.0.1 20200406 (RTEMS 6, RSB bec88a6dd856892c3e66e4598252ea07d7a0d762, Newlib ece49e4)
+A:SPINTRCRITICAL 1
+S:Platform:RTEMS
+S:Compiler:10.0.1 20200406 (RTEMS 6, RSB bec88a6dd856892c3e66e4598252ea07d7a0d762, Newlib ece49e4)
+S:Version:6.0.0.929e49a54ab4d2d18c9fb8d03610614f63e25b8d
+S:BSP:realview_pbx_a9_qemu
+S:RTEMS_DEBUG:1
+S:RTEMS_MULTIPROCESSING:0
+S:RTEMS_POSIX_API:1
+S:RTEMS_PROFILING:0
+S:RTEMS_SMP:1
+B:SemaphoreReleaseFIFOWithoutTimeout
+P:0:0:UI1:spintrcritical01impl.h:133
+P:1:0:UI1:spintrcritical01impl.h:136
+P:2:0:UI1:spintrcritical01impl.h:139
+E:SemaphoreReleaseFIFOWithoutTimeout:N:3:F:0:D:0.991790
+Z:SPINTRCRITICAL 1:C:1:N:3:F:0:D:0.992984
+Y:ReportHash:SHA256:5ae7281f5dd710e1c043bbff2fa3ddff47dc22aa5c35cff545601c8156ec1a87
+
+*** END OF TEST SPINTRCRITICAL 1 ***
Index: testsuites/sptests/spintrcritical01/spintrcritical01impl.h
===================================================================
--- testsuites/sptests/spintrcritical01/spintrcritical01impl.h	(revision 857a65dc7ed8987f5fc72f23ebcf7eba65070362)
+++ testsuites/sptests/spintrcritical01/spintrcritical01impl.h	(revision 21f733397903db061c17185a17fcee95e38ee21f)
@@ -1,3 +1,5 @@
 /*
+ *  Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ *
  *  COPYRIGHT (c) 1989-2012.
  *  On-Line Applications Research Corporation (OAR).
@@ -12,6 +14,6 @@
 #endif
 
-#include <tmacros.h>
-#include <intrcritical.h>
+#include <rtems/test.h>
+#include <rtems/test-info.h>
 
 #include <rtems/score/threadimpl.h>
@@ -19,5 +21,5 @@
 #if defined(FIFO_NO_TIMEOUT)
   #define TEST_NAME                "1"
-  #define TEST_STRING              "FIFO/Without Timeout"
+  #define TEST_STRING              FIFOWithoutTimeout
   #define SEMAPHORE_OBTAIN_TIMEOUT 0
   #define SEMAPHORE_ATTRIBUTES     RTEMS_DEFAULT_ATTRIBUTES
@@ -25,5 +27,5 @@
 #elif defined(FIFO_WITH_TIMEOUT)
   #define TEST_NAME                "2"
-  #define TEST_STRING              "FIFO/With Timeout"
+  #define TEST_STRING              FIFOWithTimeout
   #define SEMAPHORE_OBTAIN_TIMEOUT 10
   #define SEMAPHORE_ATTRIBUTES     RTEMS_DEFAULT_ATTRIBUTES
@@ -31,5 +33,5 @@
 #elif defined(PRIORITY_NO_TIMEOUT)
   #define TEST_NAME                "3"
-  #define TEST_STRING              "Priority/Without Timeout"
+  #define TEST_STRING              PriorityWithoutTimeout
   #define SEMAPHORE_OBTAIN_TIMEOUT 0
   #define SEMAPHORE_ATTRIBUTES     RTEMS_PRIORITY
@@ -37,5 +39,5 @@
 #elif defined(PRIORITY_WITH_TIMEOUT)
   #define TEST_NAME                "4"
-  #define TEST_STRING              "Priority/With Timeout"
+  #define TEST_STRING              PriorityWithTimeout
   #define SEMAPHORE_OBTAIN_TIMEOUT 10
   #define SEMAPHORE_ATTRIBUTES     RTEMS_PRIORITY
@@ -43,5 +45,5 @@
 #elif defined(PRIORITY_NO_TIMEOUT_REVERSE)
   #define TEST_NAME                "5"
-  #define TEST_STRING              "Priority/Without Timeout (Reverse)"
+  #define TEST_STRING              PriorityWithoutTimeoutReverse
   #define SEMAPHORE_OBTAIN_TIMEOUT 0
   #define SEMAPHORE_ATTRIBUTES     RTEMS_PRIORITY
@@ -54,62 +56,72 @@
 const char rtems_test_name[] = "SPINTRCRITICAL " TEST_NAME;
 
-static Thread_Control *thread;
+typedef struct {
+  Thread_Control *thread;
+  rtems_id        semaphore;
+} test_context;
 
-static rtems_id Semaphore;
-
-static bool case_hit;
-
-static bool interrupts_blocking_op(void)
+static bool is_blocked( Thread_Wait_flags flags )
 {
-  Thread_Wait_flags flags = _Thread_Wait_flags_get( thread );
-
-  return
-    flags == ( THREAD_WAIT_CLASS_OBJECT | THREAD_WAIT_STATE_INTEND_TO_BLOCK );
+  return flags == ( THREAD_WAIT_CLASS_OBJECT | THREAD_WAIT_STATE_BLOCKED );
 }
 
-static rtems_timer_service_routine test_release_from_isr(
-  rtems_id  timer,
-  void     *arg
-)
+static bool interrupts_blocking_op( Thread_Wait_flags flags )
 {
-  rtems_status_code     status;
+  return flags
+    == ( THREAD_WAIT_CLASS_OBJECT | THREAD_WAIT_STATE_INTEND_TO_BLOCK );
+}
 
-  if ( interrupts_blocking_op() ) {
-    case_hit = true;
+static T_interrupt_test_state interrupt( void *arg )
+{
+  test_context           *ctx;
+  T_interrupt_test_state  state;
+  Thread_Wait_flags       flags;
+  rtems_status_code       status;
+
+  ctx = arg;
+  flags = _Thread_Wait_flags_get( ctx->thread );
+
+  if ( interrupts_blocking_op( flags ) ) {
+    state = T_INTERRUPT_TEST_DONE;
+  } else if ( is_blocked( flags ) ) {
+    state = T_INTERRUPT_TEST_LATE;
+  } else {
+    state = T_INTERRUPT_TEST_EARLY;
   }
 
-  status = rtems_semaphore_release( Semaphore );
-  directive_failed_with_level( status, "release", -1 );
+  status = rtems_semaphore_release( ctx->semaphore );
+  T_quiet_rsc_success( status );
+
+  return state;
 }
 
+static void action( void *arg )
+{
+  test_context      *ctx;
+  rtems_status_code  status;
 
-static bool test_body( void *arg )
-{
-  rtems_status_code status;
-
-  (void) arg;
-
+  ctx = arg;
   status = rtems_semaphore_obtain(
-    Semaphore,
+    ctx->semaphore,
     RTEMS_DEFAULT_OPTIONS,
     SEMAPHORE_OBTAIN_TIMEOUT
   );
-  directive_failed( status, "rtems_semaphore_obtain" );
-
-  return case_hit;
+  T_quiet_rsc_success( status );
 }
 
-static rtems_task Init(
-  rtems_task_argument ignored
-)
+static const T_interrupt_test_config config = {
+  .action = action,
+  .interrupt = interrupt,
+  .max_iteration_count = 10000
+};
+
+T_TEST_CASE( RTEMS_XCONCAT( SemaphoreRelease, TEST_STRING ) )
 {
-  rtems_status_code     status;
+  test_context           ctx;
+  rtems_status_code      status;
+  T_interrupt_test_state state;
 
-  TEST_BEGIN();
+  ctx.thread = _Thread_Get_executing();
 
-  thread = _Thread_Get_executing();
-
-  puts( "Init - Trying to generate semaphore release from ISR while blocking" );
-  puts( "Init - Variation is: " TEST_STRING );
   status = rtems_semaphore_create(
     rtems_build_name( 'S', 'M', '1', ' ' ),
@@ -117,17 +129,18 @@
     SEMAPHORE_ATTRIBUTES,
     RTEMS_NO_PRIORITY,
-    &Semaphore
+    &ctx.semaphore
   );
-  directive_failed( status, "rtems_semaphore_create of SM1" );
+  T_rsc_success( status );
 
-  interrupt_critical_section_test( test_body, NULL, test_release_from_isr );
+  state = T_interrupt_test( &config, &ctx );
+  T_eq_int( state, T_INTERRUPT_TEST_DONE );
 
-  if ( case_hit ) {
-    puts( "Init - Case hit" );
-    TEST_END();
-  } else
-    puts( "Init - Case not hit - ran too long" );
+  rtems_semaphore_delete( ctx.semaphore );
+  T_rsc_success( status );
+}
 
-  rtems_test_exit(0);
+static rtems_task Init( rtems_task_argument argument )
+{
+  rtems_test_run( argument, TEST_STATE );
 }
 
@@ -138,7 +151,5 @@
 
 #define CONFIGURE_MAXIMUM_TASKS       1
-#define CONFIGURE_MAXIMUM_TIMERS      1
 #define CONFIGURE_MAXIMUM_SEMAPHORES  1
-#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
 #define CONFIGURE_MICROSECONDS_PER_TICK  1000
 #if defined(PRIORITY_NO_TIMEOUT_REVERSE)
Index: testsuites/sptests/spintrcritical02/spintrcritical02.scn
===================================================================
--- testsuites/sptests/spintrcritical02/spintrcritical02.scn	(revision 857a65dc7ed8987f5fc72f23ebcf7eba65070362)
+++ testsuites/sptests/spintrcritical02/spintrcritical02.scn	(revision 21f733397903db061c17185a17fcee95e38ee21f)
@@ -1,6 +1,24 @@
-*** TEST INTERRUPT CRITICAL SECTION 02 ***
-Init - Trying to generate semaphore release from ISR while blocking
-Init - Variation is: FIFO/With Timeout
-Support - rtems_timer_create - creating timer 1
-Init - Case hit
-*** END OF TEST INTERRUPT CRITICAL SECTION 02 ***
+*** BEGIN OF TEST SPINTRCRITICAL 2 ***
+*** TEST VERSION: 6.0.0.929e49a54ab4d2d18c9fb8d03610614f63e25b8d
+*** TEST STATE: EXPECTED_PASS
+*** TEST BUILD: RTEMS_DEBUG RTEMS_POSIX_API RTEMS_SMP
+*** TEST TOOLS: 10.0.1 20200406 (RTEMS 6, RSB bec88a6dd856892c3e66e4598252ea07d7a0d762, Newlib ece49e4)
+A:SPINTRCRITICAL 2
+S:Platform:RTEMS
+S:Compiler:10.0.1 20200406 (RTEMS 6, RSB bec88a6dd856892c3e66e4598252ea07d7a0d762, Newlib ece49e4)
+S:Version:6.0.0.929e49a54ab4d2d18c9fb8d03610614f63e25b8d
+S:BSP:realview_pbx_a9_qemu
+S:RTEMS_DEBUG:1
+S:RTEMS_MULTIPROCESSING:0
+S:RTEMS_POSIX_API:1
+S:RTEMS_PROFILING:0
+S:RTEMS_SMP:1
+B:SemaphoreReleaseFIFOWithTimeout
+P:0:0:UI1:spintrcritical01impl.h:133
+P:1:0:UI1:spintrcritical01impl.h:136
+P:2:0:UI1:spintrcritical01impl.h:139
+E:SemaphoreReleaseFIFOWithTimeout:N:3:F:0:D:0.993665
+Z:SPINTRCRITICAL 2:C:1:N:3:F:0:D:0.994790
+Y:ReportHash:SHA256:39afd278c3a718205440e47e93954d7a87f2bbd49fbae108199b2dbdaeadc79e
+
+*** END OF TEST SPINTRCRITICAL 2 ***
Index: testsuites/sptests/spintrcritical03/spintrcritical03.scn
===================================================================
--- testsuites/sptests/spintrcritical03/spintrcritical03.scn	(revision 857a65dc7ed8987f5fc72f23ebcf7eba65070362)
+++ testsuites/sptests/spintrcritical03/spintrcritical03.scn	(revision 21f733397903db061c17185a17fcee95e38ee21f)
@@ -1,6 +1,24 @@
-*** TEST INTERRUPT CRITICAL SECTION 03 ***
-Init - Trying to generate semaphore release from ISR while blocking
-Init - Variation is: Priority/Without Timeout
-Support - rtems_timer_create - creating timer 1
-Init - Case hit
-*** END OF TEST INTERRUPT CRITICAL SECTION 03 ***
+*** BEGIN OF TEST SPINTRCRITICAL 3 ***
+*** TEST VERSION: 6.0.0.929e49a54ab4d2d18c9fb8d03610614f63e25b8d
+*** TEST STATE: EXPECTED_PASS
+*** TEST BUILD: RTEMS_DEBUG RTEMS_POSIX_API RTEMS_SMP
+*** TEST TOOLS: 10.0.1 20200406 (RTEMS 6, RSB bec88a6dd856892c3e66e4598252ea07d7a0d762, Newlib ece49e4)
+A:SPINTRCRITICAL 3
+S:Platform:RTEMS
+S:Compiler:10.0.1 20200406 (RTEMS 6, RSB bec88a6dd856892c3e66e4598252ea07d7a0d762, Newlib ece49e4)
+S:Version:6.0.0.929e49a54ab4d2d18c9fb8d03610614f63e25b8d
+S:BSP:realview_pbx_a9_qemu
+S:RTEMS_DEBUG:1
+S:RTEMS_MULTIPROCESSING:0
+S:RTEMS_POSIX_API:1
+S:RTEMS_PROFILING:0
+S:RTEMS_SMP:1
+B:SemaphoreReleasePriorityWithoutTimeout
+P:0:0:UI1:spintrcritical01impl.h:133
+P:1:0:UI1:spintrcritical01impl.h:136
+P:2:0:UI1:spintrcritical01impl.h:139
+E:SemaphoreReleasePriorityWithoutTimeout:N:3:F:0:D:0.992575
+Z:SPINTRCRITICAL 3:C:1:N:3:F:0:D:0.993746
+Y:ReportHash:SHA256:99f47d1893183fe1353cf36b2de6f27e11bae6e1fe4ce30a88e2140d941f93aa
+
+*** END OF TEST SPINTRCRITICAL 3 ***
Index: testsuites/sptests/spintrcritical04/spintrcritical04.scn
===================================================================
--- testsuites/sptests/spintrcritical04/spintrcritical04.scn	(revision 857a65dc7ed8987f5fc72f23ebcf7eba65070362)
+++ testsuites/sptests/spintrcritical04/spintrcritical04.scn	(revision 21f733397903db061c17185a17fcee95e38ee21f)
@@ -1,6 +1,24 @@
-*** TEST INTERRUPT CRITICAL SECTION 04 ***
-Init - Trying to generate semaphore release from ISR while blocking
-Init - Variation is: Priority/With Timeout
-Support - rtems_timer_create - creating timer 1
-Init - Case hit
-*** END OF TEST INTERRUPT CRITICAL SECTION 04 ***
+*** BEGIN OF TEST SPINTRCRITICAL 4 ***
+*** TEST VERSION: 6.0.0.929e49a54ab4d2d18c9fb8d03610614f63e25b8d
+*** TEST STATE: EXPECTED_PASS
+*** TEST BUILD: RTEMS_DEBUG RTEMS_POSIX_API RTEMS_SMP
+*** TEST TOOLS: 10.0.1 20200406 (RTEMS 6, RSB bec88a6dd856892c3e66e4598252ea07d7a0d762, Newlib ece49e4)
+A:SPINTRCRITICAL 4
+S:Platform:RTEMS
+S:Compiler:10.0.1 20200406 (RTEMS 6, RSB bec88a6dd856892c3e66e4598252ea07d7a0d762, Newlib ece49e4)
+S:Version:6.0.0.929e49a54ab4d2d18c9fb8d03610614f63e25b8d
+S:BSP:realview_pbx_a9_qemu
+S:RTEMS_DEBUG:1
+S:RTEMS_MULTIPROCESSING:0
+S:RTEMS_POSIX_API:1
+S:RTEMS_PROFILING:0
+S:RTEMS_SMP:1
+B:SemaphoreReleasePriorityWithTimeout
+P:0:0:UI1:spintrcritical01impl.h:133
+P:1:0:UI1:spintrcritical01impl.h:136
+P:2:0:UI1:spintrcritical01impl.h:139
+E:SemaphoreReleasePriorityWithTimeout:N:3:F:0:D:0.992884
+Z:SPINTRCRITICAL 4:C:1:N:3:F:0:D:0.994078
+Y:ReportHash:SHA256:9881b621230969971c290ca60c366534be09a32a291699bcc786d1e654ce305c
+
+*** END OF TEST SPINTRCRITICAL 4 ***
Index: testsuites/sptests/spintrcritical05/spintrcritical05.scn
===================================================================
--- testsuites/sptests/spintrcritical05/spintrcritical05.scn	(revision 857a65dc7ed8987f5fc72f23ebcf7eba65070362)
+++ testsuites/sptests/spintrcritical05/spintrcritical05.scn	(revision 21f733397903db061c17185a17fcee95e38ee21f)
@@ -1,6 +1,24 @@
-*** TEST INTERRUPT CRITICAL SECTION 05 ***
-Init - Trying to generate semaphore release from ISR while blocking
-Init - Variation is: Priority/Without Timeout (Reverse)
-Support - rtems_timer_create - creating timer 1
-Init - Case hit
-*** END OF TEST INTERRUPT CRITICAL SECTION 05 ***
+*** BEGIN OF TEST SPINTRCRITICAL 5 ***
+*** TEST VERSION: 6.0.0.929e49a54ab4d2d18c9fb8d03610614f63e25b8d
+*** TEST STATE: EXPECTED_PASS
+*** TEST BUILD: RTEMS_DEBUG RTEMS_POSIX_API RTEMS_SMP
+*** TEST TOOLS: 10.0.1 20200406 (RTEMS 6, RSB bec88a6dd856892c3e66e4598252ea07d7a0d762, Newlib ece49e4)
+A:SPINTRCRITICAL 5
+S:Platform:RTEMS
+S:Compiler:10.0.1 20200406 (RTEMS 6, RSB bec88a6dd856892c3e66e4598252ea07d7a0d762, Newlib ece49e4)
+S:Version:6.0.0.929e49a54ab4d2d18c9fb8d03610614f63e25b8d
+S:BSP:realview_pbx_a9_qemu
+S:RTEMS_DEBUG:1
+S:RTEMS_MULTIPROCESSING:0
+S:RTEMS_POSIX_API:1
+S:RTEMS_PROFILING:0
+S:RTEMS_SMP:1
+B:SemaphoreReleasePriorityWithoutTimeoutReverse
+P:0:0:UI1:spintrcritical01impl.h:133
+P:1:0:UI1:spintrcritical01impl.h:136
+P:2:0:UI1:spintrcritical01impl.h:139
+E:SemaphoreReleasePriorityWithoutTimeoutReverse:N:3:F:0:D:0.992161
+Z:SPINTRCRITICAL 5:C:1:N:3:F:0:D:0.993438
+Y:ReportHash:SHA256:577ac55f827103c83e8a851796041d45d9545e7f02e49417fdb0b876108c6327
+
+*** END OF TEST SPINTRCRITICAL 5 ***
