summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-09-02 09:03:39 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-09-02 13:27:38 +0200
commit209562c67fc76dbc5c3aa2f255ee6f2d7abb7f07 (patch)
treedadbe366c8045d2ec2a8db5b8f0b764bbc30496e
parentspec: Add not prequalified constraints (diff)
downloadrtems-central-209562c67fc76dbc5c3aa2f255ee6f2d7abb7f07.tar.bz2
spec: Add requirements for unit tests
-rw-r--r--spec/req/unit-test-data-structures.yml18
-rw-r--r--spec/req/unit-test-dead-code.yml19
-rw-r--r--spec/rtems/config/unit/config.yml4
-rw-r--r--spec/score/msgq/unit/msgq.yml4
-rw-r--r--spec/score/rbtree/unit/rbtree.yml4
5 files changed, 46 insertions, 3 deletions
diff --git a/spec/req/unit-test-data-structures.yml b/spec/req/unit-test-data-structures.yml
new file mode 100644
index 00000000..613b91b5
--- /dev/null
+++ b/spec/req/unit-test-data-structures.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: true
+links:
+- role: requirement-refinement
+ uid: root
+non-functional-type: design
+rationale: |
+ Implementations to support data structures such as red-black trees a
+ sufficiently complex to require unit tests. Testing through the API is
+ impractical.
+references: []
+requirement-type: non-functional
+text: |
+ Unit tests may be used to test code which implements reusable data
+ structures.
+type: requirement
diff --git a/spec/req/unit-test-dead-code.yml b/spec/req/unit-test-dead-code.yml
new file mode 100644
index 00000000..57961d16
--- /dev/null
+++ b/spec/req/unit-test-dead-code.yml
@@ -0,0 +1,19 @@
+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:
+- role: requirement-refinement
+ uid: root
+non-functional-type: design
+rationale: |
+ In general, dead code should be avoided. For justified exceptions it is
+ acceptable, for example to avoid hard to maintain deviations from the RTEMS
+ mainline code. For these exceptions, unit tests may be used to achieve the
+ code and branch coverage goals.
+references: []
+requirement-type: non-functional
+text: |
+ Unit tests may be used to test code which is not testable through the
+ ${/glossary/api:/term}.
+type: requirement
diff --git a/spec/rtems/config/unit/config.yml b/spec/rtems/config/unit/config.yml
index 031f471d..c81ad8ae 100644
--- a/spec/rtems/config/unit/config.yml
+++ b/spec/rtems/config/unit/config.yml
@@ -2,7 +2,9 @@ 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
-links: []
+links:
+- role: requirement-refinement
+ uid: /req/unit-test-dead-code
test-actions:
- action-brief: |
Call get_config_max() indirectly through
diff --git a/spec/score/msgq/unit/msgq.yml b/spec/score/msgq/unit/msgq.yml
index dee7e3ef..06a609a0 100644
--- a/spec/score/msgq/unit/msgq.yml
+++ b/spec/score/msgq/unit/msgq.yml
@@ -2,7 +2,9 @@ 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
-links: []
+links:
+- role: requirement-refinement
+ uid: /req/unit-test-dead-code
test-actions:
#### _CORE_message_queue_Insert_message() ####################################
diff --git a/spec/score/rbtree/unit/rbtree.yml b/spec/score/rbtree/unit/rbtree.yml
index 64c7f921..1723e67a 100644
--- a/spec/score/rbtree/unit/rbtree.yml
+++ b/spec/score/rbtree/unit/rbtree.yml
@@ -3,7 +3,9 @@ copyrights:
- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
- Copyright (C) 2010 Gedare Bloom
enabled-by: true
-links: []
+links:
+- role: requirement-refinement
+ uid: /req/unit-test-data-structures
test-actions:
- action-brief: |
Call _RBTree_Initialize_one() and check the tree properties.