[PATCH] validation: Always test spurious interrupts

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Jul 5 08:46:51 UTC 2022


---
 .../testsuites/validation/validation-intr.yml |  4 +++-
 .../validation/validation-smp-only-0.yml      |  2 --
 .../validation/tc-bsp-interrupt-spurious.c    | 24 ++++++++-----------
 3 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/spec/build/testsuites/validation/validation-intr.yml b/spec/build/testsuites/validation/validation-intr.yml
index 3bef9b7c9c..ced15b9490 100644
--- a/spec/build/testsuites/validation/validation-intr.yml
+++ b/spec/build/testsuites/validation/validation-intr.yml
@@ -8,9 +8,11 @@ cxxflags: []
 enabled-by: true
 features: c cprogram
 includes: []
-ldflags: []
+ldflags:
+- -Wl,--wrap=bsp_interrupt_handler_default
 links: []
 source:
+- testsuites/validation/tc-bsp-interrupt-spurious.c
 - testsuites/validation/tc-intr-clear.c
 - testsuites/validation/tc-intr-entry-install.c
 - testsuites/validation/tc-intr-entry-remove.c
diff --git a/spec/build/testsuites/validation/validation-smp-only-0.yml b/spec/build/testsuites/validation/validation-smp-only-0.yml
index fc4091b92e..7ed2f7c943 100644
--- a/spec/build/testsuites/validation/validation-smp-only-0.yml
+++ b/spec/build/testsuites/validation/validation-smp-only-0.yml
@@ -9,12 +9,10 @@ enabled-by: RTEMS_SMP
 features: c cprogram
 includes: []
 ldflags:
-- -Wl,--wrap=bsp_interrupt_handler_default
 - -Wl,--wrap=_Scheduler_EDF_SMP_Yield
 links: []
 source:
 - testsuites/validation/tc-acfg-scheduler-edf-smp.c
-- testsuites/validation/tc-bsp-interrupt-spurious.c
 - testsuites/validation/tc-intr-smp-only.c
 - testsuites/validation/tc-scheduler-smp-only.c
 - testsuites/validation/tc-sched-smp.c
diff --git a/testsuites/validation/tc-bsp-interrupt-spurious.c b/testsuites/validation/tc-bsp-interrupt-spurious.c
index de139337da..0cb14f8f1a 100644
--- a/testsuites/validation/tc-bsp-interrupt-spurious.c
+++ b/testsuites/validation/tc-bsp-interrupt-spurious.c
@@ -63,7 +63,7 @@
  * @defgroup RTEMSTestCaseBspReqInterruptSpurious \
  *   spec:/bsp/req/interrupt-spurious
  *
- * @ingroup RTEMSTestSuiteTestsuitesValidationSmpOnly0
+ * @ingroup RTEMSTestSuiteTestsuitesValidationIntr
  *
  * @{
  */
@@ -416,28 +416,24 @@ static void BspReqInterruptSpurious_Action(
   BspReqInterruptSpurious_Context *ctx
 )
 {
+  rtems_status_code sc;
+
   ctx->interrupt_occurred = false;
   ctx->entry_counter = 0;
   ctx->fatal_counter = 0;
   ctx->fatal_source = RTEMS_FATAL_SOURCE_LAST;
   ctx->fatal_code = UINT32_MAX;
 
-  if ( *ctx->first == NULL ) {
-    rtems_status_code sc;
-
-    (void) rtems_interrupt_vector_enable( ctx->test_vector );
-
-    sc = rtems_interrupt_raise( ctx->test_vector );
-    T_rsc_success( sc );
+  (void) rtems_interrupt_vector_enable( ctx->test_vector );
 
-    while ( !ctx->interrupt_occurred ) {
-      /* Wait */
-    }
+  sc = rtems_interrupt_raise( ctx->test_vector );
+  T_rsc_success( sc );
 
-    Disable( ctx );
-  } else {
-    bsp_interrupt_spurious( ctx->test_vector );
+  while ( !ctx->interrupt_occurred ) {
+    /* Wait */
   }
+
+  Disable( ctx );
 }
 
 static const BspReqInterruptSpurious_Entry
-- 
2.35.3



More information about the devel mailing list