[rtems-central commit] spec: Application configuration options validation

Sebastian Huber sebh at rtems.org
Mon Sep 5 13:43:53 UTC 2022


Module:    rtems-central
Branch:    master
Commit:    48bcaffc167bd7a553c457fcc103e5e4e8b33b0c
Changeset: http://git.rtems.org/rtems-central/commit/?id=48bcaffc167bd7a553c457fcc103e5e4e8b33b0c

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Sep  5 15:52:31 2022 +0200

spec: Application configuration options validation

---

 spec/acfg/req/scheduler-assignments-no-smp.yml    | 18 +++++++++++
 spec/acfg/req/scheduler-edf-smp-no-smp.yml        | 18 +++++++++++
 spec/acfg/req/scheduler-edf-smp.yml               |  2 +-
 spec/acfg/val/scheduler-assignments-no-smp.yml    | 18 +++++++++++
 spec/acfg/val/scheduler-edf-smp-no-smp.yml        | 18 +++++++++++
 spec/acfg/val/scheduler-table-entries-one-cpu.yml | 37 +++++++++++++++++++++++
 spec/testsuites/validation-one-cpu-1.yml          |  6 +++-
 7 files changed, 115 insertions(+), 2 deletions(-)

diff --git a/spec/acfg/req/scheduler-assignments-no-smp.yml b/spec/acfg/req/scheduler-assignments-no-smp.yml
new file mode 100644
index 00000000..b02ddafd
--- /dev/null
+++ b/spec/acfg/req/scheduler-assignments-no-smp.yml
@@ -0,0 +1,18 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by:
+  not: RTEMS_SMP
+functional-type: function
+links:
+- role: interface-function
+  uid: ../if/scheduler-assignments
+- role: requirement-refinement
+  uid: group
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  Using the ${../if/scheduler-assignments:/name} application configuration
+  option in an application configuration shall have no effect.
+type: requirement
diff --git a/spec/acfg/req/scheduler-edf-smp-no-smp.yml b/spec/acfg/req/scheduler-edf-smp-no-smp.yml
new file mode 100644
index 00000000..f41714c6
--- /dev/null
+++ b/spec/acfg/req/scheduler-edf-smp-no-smp.yml
@@ -0,0 +1,18 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by:
+  not: RTEMS_SMP
+functional-type: function
+links:
+- role: interface-function
+  uid: ../if/scheduler-edf-smp
+- role: requirement-refinement
+  uid: group
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  Using the ${../if/scheduler-edf-smp:/name} application configuration option
+  in an application configuration shall result in a C preprocessor error.
+type: requirement
diff --git a/spec/acfg/req/scheduler-edf-smp.yml b/spec/acfg/req/scheduler-edf-smp.yml
index 7e0a3153..bffcd116 100644
--- a/spec/acfg/req/scheduler-edf-smp.yml
+++ b/spec/acfg/req/scheduler-edf-smp.yml
@@ -1,7 +1,7 @@
 SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
 copyrights:
 - Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
-enabled-by: true
+enabled-by: RTEMS_SMP
 functional-type: function
 links:
 - role: interface-function
diff --git a/spec/acfg/val/scheduler-assignments-no-smp.yml b/spec/acfg/val/scheduler-assignments-no-smp.yml
new file mode 100644
index 00000000..0e77da38
--- /dev/null
+++ b/spec/acfg/val/scheduler-assignments-no-smp.yml
@@ -0,0 +1,18 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by:
+  not: RTEMS_SMP
+links:
+- role: validation
+  uid: ../req/scheduler-assignments-no-smp
+method: by-inspection
+references:
+- identifier: cpukit/include/rtems/confdefs/scheduler.h
+  hash: n7NtRWzAfA388_1hPYGdZ59wHBC2ZWqz2qo3Yrc5vS8=
+  type: file
+text: |
+  Inspection of the referenced ${/glossary/sourcecode:/term} file showed that
+  using ${../if/scheduler-assignments:/name} where ${/build-options/if/smp:/name}
+  is not defined will have no effect.
+type: validation
diff --git a/spec/acfg/val/scheduler-edf-smp-no-smp.yml b/spec/acfg/val/scheduler-edf-smp-no-smp.yml
new file mode 100644
index 00000000..895ec84a
--- /dev/null
+++ b/spec/acfg/val/scheduler-edf-smp-no-smp.yml
@@ -0,0 +1,18 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by:
+  not: RTEMS_SMP
+links:
+- role: validation
+  uid: ../req/scheduler-edf-smp-no-smp
+method: by-inspection
+references:
+- identifier: cpukit/include/rtems/scheduler.h
+  hash: jS_Dp1UFQrh0kgBrYi56gmkqmkEWrDSGV-tRxHfLbo4=
+  type: file
+text: |
+  Inspection of the referenced ${/glossary/sourcecode:/term} file showed that
+  using ${../if/scheduler-edf-smp:/name} where ${/build-options/if/smp:/name}
+  is not defined will result in a C preprocessor error.
+type: validation
diff --git a/spec/acfg/val/scheduler-table-entries-one-cpu.yml b/spec/acfg/val/scheduler-table-entries-one-cpu.yml
new file mode 100644
index 00000000..2286fe52
--- /dev/null
+++ b/spec/acfg/val/scheduler-table-entries-one-cpu.yml
@@ -0,0 +1,37 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links: []
+test-actions:
+- action-brief: |
+    Check the effect of the application configuration option.
+  action-code: |
+    /* Nothing to do */
+  checks:
+  - brief: |
+      Check that the ${/acfg/if/scheduler-table-entries:/name} application
+      configuration option resulted in the expected system setting using
+      ${/rtems/task/if/maximum-priority:/name}.
+    code: |
+      T_eq_u32( RTEMS_MAXIMUM_PRIORITY, 63 );
+    links:
+    - role: validation
+      uid: ../req/scheduler-table-entries
+  links: []
+test-brief: |
+  Tests the effect of ${/acfg/if/scheduler-table-entries:/name} the application
+  configuration options in a configuration with only one processor.
+test-context: []
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+test-local-includes: []
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tc-acfg-scheduler-table-entries-one-cpu.c
+test-teardown: null
+type: test-case
diff --git a/spec/testsuites/validation-one-cpu-1.yml b/spec/testsuites/validation-one-cpu-1.yml
index 3ce5f144..8f02d5f2 100644
--- a/spec/testsuites/validation-one-cpu-1.yml
+++ b/spec/testsuites/validation-one-cpu-1.yml
@@ -16,12 +16,16 @@ test-code: |
 
   #define CONFIGURE_MAXIMUM_PROCESSORS 1
 
+  #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+    RTEMS_SCHEDULER_TABLE_PRIORITY( a, TEST_SCHEDULER_A_NAME )
+
   #include "ts-default.h"
 test-description: |
   Two test suites of this configuration are provided to limit test run
   duration.
 test-includes: []
-test-local-includes: []
+test-local-includes:
+- ts-config.h
 test-suite-name: ValidationOneCpu1
 test-target: testsuites/validation/ts-validation-one-cpu-1.c
 type: test-suite



More information about the vc mailing list