Skip to content

Commit

Permalink
Add checker bundle automatically generated doc (#46)
Browse files Browse the repository at this point in the history
Signed-off-by: hoangtungdinh <11166240+hoangtungdinh@users.noreply.github.com>
  • Loading branch information
hoangtungdinh authored Aug 19, 2024
1 parent 7f1b347 commit 2909dc0
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ htmlcov
coverage.xml
.coverage*
.python-version
generated_checker_bundle_doc.md
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# qc-openscenarioxml

This project implements the OpenScenario Checker for the ASAM Quality Checker project.
This project implements the [ASAM OpenScenario XML Checker](checker_bundle_doc.md) for the ASAM Quality Checker project.

## Installation

Expand Down
49 changes: 49 additions & 0 deletions checker_bundle_doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Checker bundle: xoscBundle

* Build version: 0.1.0
* Description: ASAM OpenScenario XML checker bundle

## Parameters

* InputFile: The path of the input file.

## Checkers

### basic_xosc

* Description: Check if basic properties of input file are properly set
* Addressed rules:
* asam.net:xosc:1.0.0:xml.valid_xml_document

### schema_xosc

* Description: Check if xml properties of input file are properly set
* Addressed rules:
* asam.net:xosc:1.0.0:xml.valid_schema

### reference_xosc

* Description: Check if xml properties of input file are properly set
* Addressed rules:
* asam.net:xosc:1.2.0:reference_control.uniquely_resolvable_entity_references
* asam.net:xosc:1.2.0:reference_control.resolvable_signal_id_in_traffic_signal_state_action
* asam.net:xosc:1.2.0:reference_control.resolvable_traffic_signal_controller_by_traffic_signal_controller_ref
* asam.net:xosc:1.2.0:reference_control.valid_actor_reference_in_private_actions
* asam.net:xosc:1.2.0:reference_control.resolvable_entity_references
* asam.net:xosc:1.2.0:reference_control.resolvable_variable_reference
* asam.net:xosc:1.2.0:reference_control.resolvable_storyboard_element_reference
* asam.net:xosc:1.2.0:reference_control.unique_element_names_on_same_level

### parameters_xosc

* Description: Check if parameters properties of input file are properly set
* Addressed rules:
* asam.net:xosc:1.2.0:parameters.valid_parameter_declaration_in_catalogs

### data_type_xosc

* Description: Check if data_type properties of input file are properly set
* Addressed rules:
* asam.net:xosc:1.2.0:data_type.allowed_operators
* asam.net:xosc:1.2.0:data_type.non_negative_transition_time_in_light_state_action
* asam.net:xosc:1.2.0:data_type.positive_duration_in_phase
5 changes: 5 additions & 0 deletions qc_openscenario/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def args_entrypoint() -> argparse.Namespace:
group.add_argument("-d", "--default_config", action="store_true")
group.add_argument("-c", "--config_path")

parser.add_argument("-g", "--generate_markdown", action="store_true")

return parser.parse_args()


Expand Down Expand Up @@ -75,6 +77,9 @@ def main():
)
)

if args.generate_markdown:
result.write_markdown_doc("generated_checker_bundle_doc.md")

logging.info("Done")


Expand Down
6 changes: 1 addition & 5 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ def launch_main(monkeypatch):
monkeypatch.setattr(
sys,
"argv",
[
"main.py",
"-c",
CONFIG_FILE_PATH,
],
["main.py", "-c", CONFIG_FILE_PATH, "--generate_markdown"],
)
main.main()

Expand Down

0 comments on commit 2909dc0

Please sign in to comment.