-
Notifications
You must be signed in to change notification settings - Fork 33
test: missing attribute tests #848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AlexanderLanin
merged 1 commit into
eclipse-score:main
from
etas-contrib:test-attribute-checks
Sep 22, 2026
+240
β0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
177 changes: 177 additions & 0 deletions
177
src/extensions/score_metamodel/tests/rst/attributes/test_common_attr_safety.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,177 @@ | ||
| .. | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
|
|
||
| .. test_metadata:: Test Common Attribute Safety | ||
| :id: test_metadata__common_attr_safety | ||
| :fully_verifies_list: tool_req__docs_common_attr_safety | ||
| :test_type: requirements_based | ||
| :derivation_technique: requirements_based | ||
|
|
||
| Tests that the safety attribute only accepts the values QM and ASIL_B. | ||
| The rule applies to all requirement types except process and tool | ||
| requirements, and to all architecture element types. | ||
|
|
||
|
|
||
|
|
||
| .. stkh_req:: Safety QM | ||
| :id: stkh_req__common_attr_safety__qm | ||
| :version: 1 | ||
| :reqtype: Functional | ||
| :safety: QM | ||
| :security: NO | ||
| :status: valid | ||
| :rationale: valid safety value | ||
| :valid_from: v1.0 | ||
| :expect_not: does not follow pattern | ||
|
|
||
| .. stkh_req:: Safety ASIL_B | ||
| :id: stkh_req__common_attr_safety__asil_b | ||
| :version: 1 | ||
| :reqtype: Functional | ||
| :safety: ASIL_B | ||
| :security: NO | ||
| :status: valid | ||
| :rationale: valid safety value | ||
| :valid_from: v1.0 | ||
| :expect_not: does not follow pattern | ||
|
|
||
| .. stkh_req:: Safety YES | ||
| :id: stkh_req__common_attr_safety__bad | ||
| :version: 1 | ||
| :reqtype: Functional | ||
| :safety: YES | ||
| :security: NO | ||
| :status: valid | ||
| :rationale: invalid safety value | ||
| :valid_from: v1.0 | ||
| :expect: does not follow pattern | ||
|
|
||
|
|
||
| .. feat_req:: Safety YES | ||
| :id: feat_req__common_attr_safety__bad | ||
| :version: 1 | ||
| :reqtype: Functional | ||
| :safety: True | ||
| :security: NO | ||
| :status: valid | ||
| :valid_from: v1.0 | ||
| :satisfied_by: feat__brake | ||
| :expect: does not follow pattern | ||
|
|
||
| Invalid safety value YES. | ||
|
|
||
|
|
||
| .. comp_req:: Safety YES | ||
| :id: comp_req__common_attr_safety__bad | ||
| :version: 1 | ||
| :reqtype: Functional | ||
| :safety: safe | ||
| :security: NO | ||
| :status: valid | ||
| :satisfied_by: comp__smoke | ||
| :expect: does not follow pattern | ||
|
|
||
| Invalid safety value YES. | ||
|
|
||
|
|
||
| .. aou_req:: Safety YES | ||
| :id: aou_req__common_attr_safety__bad | ||
| :version: 1 | ||
| :reqtype: Functional | ||
| :safety: ASIL | ||
| :security: NO | ||
| :status: valid | ||
| :expect: does not follow pattern | ||
|
|
||
| Invalid safety value YES. | ||
|
|
||
|
|
||
| .. feat:: Safety YES | ||
| :id: feat__brake | ||
| :version: 1 | ||
| :safety: unsafe | ||
| :security: NO | ||
| :status: valid | ||
| :expect: does not follow pattern | ||
|
|
||
|
|
||
| .. feat_arc_sta:: Safety YES | ||
| :id: feat_arc_sta__common_attr_safety__bad | ||
| :version: 1 | ||
| :safety: NO | ||
| :security: NO | ||
| :status: valid | ||
| :includes: logic_arc_int__raw, logic_arc_int_op__flip | ||
| :belongs_to: feat__brake | ||
| :expect: does not follow pattern | ||
|
|
||
|
|
||
| .. logic_arc_int:: Safety YES | ||
| :id: logic_arc_int__raw | ||
| :version: 1 | ||
| :safety: ISO26262 | ||
| :security: NO | ||
| :status: valid | ||
| :expect: does not follow pattern | ||
|
|
||
|
|
||
| .. logic_arc_int_op:: Safety YES | ||
| :id: logic_arc_int_op__flip | ||
| :version: 1 | ||
| :safety: invalid | ||
| :security: NO | ||
| :status: valid | ||
| :included_by: logic_arc_int__raw | ||
| :expect: does not follow pattern | ||
|
|
||
|
|
||
| .. comp_arc_sta:: Safety YES | ||
| :id: comp_arc_sta__common_attr_safety__bad | ||
| :version: 1 | ||
| :safety: draft | ||
| :security: NO | ||
| :status: valid | ||
| :belongs_to: comp__smoke | ||
| :expect: does not follow pattern | ||
|
|
||
|
|
||
| .. comp:: Safety YES | ||
| :id: comp__smoke | ||
| :version: 1 | ||
| :safety: tbd | ||
| :security: NO | ||
| :status: valid | ||
| :belongs_to: feat__brake | ||
| :expect: does not follow pattern | ||
|
|
||
|
|
||
| .. real_arc_int:: Safety YES | ||
| :id: real_arc_int__eth | ||
| :version: 1 | ||
| :safety: bla | ||
| :security: NO | ||
| :status: valid | ||
| :language: cpp | ||
| :expect: does not follow pattern | ||
|
|
||
|
|
||
| .. real_arc_int_op:: Safety YES | ||
| :id: real_arc_int_op__erase | ||
| :version: 1 | ||
| :safety: unclear | ||
| :security: NO | ||
| :status: valid | ||
| :included_by: real_arc_int__eth | ||
| :expect: does not follow pattern |
63 changes: 63 additions & 0 deletions
63
src/extensions/score_metamodel/tests/rst/attributes/test_common_attr_version.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| .. | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
|
|
||
| .. test_metadata:: Test Common Attribute Version | ||
| :id: test_metadata__common_attr_version | ||
| :partially_verifies_list: tool_req__docs_common_attr_version | ||
| :test_type: requirements_based | ||
| :derivation_technique: requirements_based | ||
|
|
||
| Tests that a versioning attribute is mandatory for all needs and that it | ||
| accepts whole numbers. | ||
|
|
||
| Partial because "rejects non-whole numbers" cannot be tested with this rst-file approach. | ||
|
|
||
| .. Valid whole-number version. | ||
|
|
||
| .. stkh_req:: Version 1 | ||
| :id: stkh_req__common_attr_version__aaaa | ||
| :version: 1 | ||
| :reqtype: Functional | ||
| :safety: QM | ||
| :security: NO | ||
| :status: valid | ||
| :rationale: valid version | ||
| :valid_from: v1.0 | ||
| :expect_not: is missing required attribute: `version` | ||
|
|
||
| .. Valid larger whole-number version. | ||
|
|
||
| .. stkh_req:: Version 34 | ||
| :id: stkh_req__common_attr_version__bbbb | ||
| :version: 34 | ||
| :reqtype: Functional | ||
| :safety: QM | ||
| :security: NO | ||
| :status: valid | ||
| :rationale: valid version | ||
| :valid_from: v1.0 | ||
| :expect_not: is missing required attribute: `version` | ||
|
|
||
| .. Missing version is rejected because the version attribute is mandatory. | ||
|
|
||
| .. stkh_req:: No version | ||
| :id: stkh_req__common_attr_version__cccc | ||
| :reqtype: Functional | ||
| :safety: QM | ||
| :security: NO | ||
| :status: valid | ||
| :rationale: missing version | ||
| :valid_from: v1.0 | ||
| :expect: is missing required attribute: `version` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really? Would this not be a metamodel error if it's non whole number? Cause the regex?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that this is not a metamodel warning but a sphinx-needs warning. Example: