summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-05-05 14:41:20 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-05-08 21:58:56 +0200
commit06ca6f47be605f2ccd705927ee83f6a05b48e81c (patch)
treef7e5033456c7f0035f9f5e5f3c917ce2bfc620bb
parentspec: Fix enabled-by for libio group (diff)
downloadrtems-central-06ca6f47be605f2ccd705927ee83f6a05b48e81c.tar.bz2
spec: Add functional type for undefined defines
-rw-r--r--spec/rtems/basedefs/req/no-static-analysis.yml (renamed from spec/rtems/basedefs/req/static-analysis-0.yml)8
-rw-r--r--spec/rtems/basedefs/req/static-analysis-1.yml15
-rw-r--r--spec/rtems/basedefs/val/basedefs.yml41
-rw-r--r--spec/spec/requirement-functional-generic.yml4
4 files changed, 17 insertions, 51 deletions
diff --git a/spec/rtems/basedefs/req/static-analysis-0.yml b/spec/rtems/basedefs/req/no-static-analysis.yml
index d87021b8..7ec9ea27 100644
--- a/spec/rtems/basedefs/req/static-analysis-0.yml
+++ b/spec/rtems/basedefs/req/no-static-analysis.yml
@@ -1,8 +1,9 @@
SPDX-License-Identifier: CC-BY-SA-4.0
copyrights:
- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
-enabled-by: true
-functional-type: function
+enabled-by:
+ not: __COVERITY__
+functional-type: interface-define-not-defined
links:
- role: interface-function
uid: ../if/static-analysis
@@ -10,6 +11,5 @@ rationale: null
references: []
requirement-type: functional
text: |
- When the macro ``__COVERITY__`` is defined,
- the macro ${../if/static-analysis:/name} shall be defined.
+ The define ${../if/static-analysis:/name} shall not be defined.
type: requirement
diff --git a/spec/rtems/basedefs/req/static-analysis-1.yml b/spec/rtems/basedefs/req/static-analysis-1.yml
deleted file mode 100644
index bd7cec3d..00000000
--- a/spec/rtems/basedefs/req/static-analysis-1.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-SPDX-License-Identifier: CC-BY-SA-4.0
-copyrights:
-- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
-enabled-by: true
-functional-type: function
-links:
-- role: interface-function
- uid: ../if/static-analysis
-rationale: null
-references: []
-requirement-type: functional
-text: |
- When the macro ``__COVERITY__`` is not defined,
- the macro ${../if/static-analysis:/name} shall be not defined.
-type: requirement
diff --git a/spec/rtems/basedefs/val/basedefs.yml b/spec/rtems/basedefs/val/basedefs.yml
index 1005faee..740b1412 100644
--- a/spec/rtems/basedefs/val/basedefs.yml
+++ b/spec/rtems/basedefs/val/basedefs.yml
@@ -951,44 +951,21 @@ test-actions:
uid: ../req/section-0
links: []
- action-brief: |
- Use the ${../if/static-analysis:/name} macro.
+ Evaluate if ${../if/static-analysis:/name} is defined.
action-code: |
- /* No action */
- checks:
- - brief: |
- It cannot be automatically check that
- the ${../if/static-analysis:/name} macro has the desired effect.
- code: |
- #if defined(__COVERITY__)
- # if defined(RTEMS_STATIC_ANALYSIS)
- T_quiet_true( true, "test passes, no output" );
- # else
- T_quiet_true( false, "RTEMS_STATIC_ANALYSIS not defined" );
- # endif
- #endif
- links:
- - role: validation
- uid: ../req/static-analysis-0
- links: []
-- action-brief: |
- Use the ${../if/static-analysis:/name} macro.
- action-code: |
- /* No action */
+ #if defined(RTEMS_STATIC_ANALYSIS)
+ bool defined = true;
+ #else
+ bool defined = false;
+ #endif
checks:
- brief: |
- It cannot be automatically check that
- the ${../if/static-analysis:/name} macro has the desired effect.
+ Check that ${../if/static-analysis:/name} was not defined.
code: |
- #if !defined(__COVERITY__)
- # if !defined(RTEMS_STATIC_ANALYSIS)
- T_quiet_true( true, "test passes, no output" );
- # else
- T_quiet_true( false, "RTEMS_STATIC_ANALYSIS defined" );
- # endif
- #endif
+ T_step_false( ${.:/step}, defined );
links:
- role: validation
- uid: ../req/static-analysis-1
+ uid: ../req/no-static-analysis
links: []
- action-brief: |
Use the ${../if/static-assert:/name} macro.
diff --git a/spec/spec/requirement-functional-generic.yml b/spec/spec/requirement-functional-generic.yml
index 99717bf4..e2fe53cb 100644
--- a/spec/spec/requirement-functional-generic.yml
+++ b/spec/spec/requirement-functional-generic.yml
@@ -19,6 +19,10 @@ links:
uid: requirement-functional
- role: spec-refinement
spec-key: functional-type
+ spec-value: interface-define-not-defined
+ uid: requirement-functional
+- role: spec-refinement
+ spec-key: functional-type
spec-value: operational
uid: requirement-functional
- role: spec-refinement