|
| 1 | +ifndef::include-only-once[] |
| 2 | +:root-path: ../ |
| 3 | +include::{root-path}_config.adoc[] |
| 4 | +endif::[] |
| 5 | + |
| 6 | +# Test scripts |
| 7 | + |
| 8 | +The following collection of test scripts is designed to automate the validation and enforcement of coding standards, documentation quality, and specific syntactical conventions within a software development project. |
| 9 | +These scripts cover a broad spectrum of checks, from Python package initialization, adherence to comment standards, and validation of Doxygen documentation output, to ensuring the integrity of Protocol Buffer (.proto) files. |
| 10 | +Each script focuses on a specific aspect of the code or documentation, automating the process of identifying common errors, enforcing naming conventions, and ensuring that documentation is both accurate and adheres to defined standards. |
| 11 | +Through these automated tests, the project aims to maintain high quality in coding and documentation standards, facilitating a more reliable and efficient development process. |
| 12 | + |
| 13 | +## `\\__init__.py` |
| 14 | + |
| 15 | +This script indicates the use of the directory as a Python Package, allowing Python to consider the directory as part of a module. |
| 16 | + |
| 17 | +## `test_comment_type.py` |
| 18 | + |
| 19 | +Automates the administration of comment standards. |
| 20 | +It locates all `.proto` files using the glob module and includes different test cases inherited from `unittest.TestCase`. |
| 21 | +These test cases perform checks on the comment description's brevity, length, and existence. Additionally, it includes a utility method `convert` for transforming camel case names into uppercase snake case, ensuring high documentation and coding standards in Protocol Buffer Files. |
| 22 | + |
| 23 | +## `test_doxygen_output.py` |
| 24 | + |
| 25 | +Validates the output of Doxygen documentation files to ensure the absence of errors or issues in documentation syntax or Doxygen's interpretation of comments. |
| 26 | +It checks for hash characters `(#)`, slash triplets `(///)`, and backslash triplets `(\\\)` that might indicate documentation errors, maintaining the quality of Doxygen-generated HTML documentation. |
| 27 | + |
| 28 | +## `test_invalid_comment.py` |
| 29 | + |
| 30 | +Ensures the integrity of comments within Protocol buffer files, checking for the use of more than two consecutive forward slashes `(///)` and block comment delimiters ``(/* and */)``, which are not supported in Protocol Buffers syntax. |
| 31 | + |
| 32 | +## `test_invalid_enum.py` |
| 33 | + |
| 34 | +Checks `.proto` files for issues related to enum naming and usage, verifying that enum names follow a PascalCase naming convention and that enum types are in uppercase, ensuring adherence to naming conventions. |
| 35 | + |
| 36 | +## `test_invalid_html.py` |
| 37 | + |
| 38 | +Validates the use of HTML and Doxygen-specific comment syntax within `.proto` files, checking for incorrect usage of slashes `(/,\)`, hash `(#)` characters, `@` symbols outside of `htmlonly` sections, and ensuring that every `htmlonly` section is properly closed. |
| 39 | + |
| 40 | +## `test_invalid_message.py` |
| 41 | + |
| 42 | +Defines tests for common issues in `.proto` files, such as naming conventions and field definitions, ensuring that message names, field names, and nested message types adhere to specified naming conventions and that fields specify their multiplicity correctly. |
| 43 | + |
| 44 | +## `test_invalid_punctuation.py` |
| 45 | + |
| 46 | +Aims to ensure the absence of double underscores `(__)` in `.proto` files, indicating a formatting error when such punctuation is found. |
| 47 | + |
| 48 | +## `test_invalid_tabs.py` |
| 49 | + |
| 50 | +Prohibits the use of tab characters for indentation or alignment in `.proto` files, considering their use a formatting error. |
| 51 | + |
| 52 | +## `test_newline.py` |
| 53 | + |
| 54 | +Ensures that all Protocol Buffer `(.proto)` files end with a newline character `(\n)`, maintaining code quality and interoperability across different environments. |
| 55 | + |
| 56 | +## `test_non_ascii.py` |
| 57 | + |
| 58 | +Ensures that Protocol Buffer `(.proto)` files do not contain non-ASCII characters, checking for the presence of special characters outside the ASCII set `(eg. ä,ü,ö etc.)` and failing the test if any are found. |
| 59 | + |
| 60 | +## `test_osi_trace.py` |
| 61 | + |
| 62 | +Serves as a unit test for the `OSITrace` class, ensuring correct processing of OSI SensorView messages and their conversion into a human-readable format. |
| 63 | + |
| 64 | +## `test_rules.py` |
| 65 | + |
| 66 | +Ensures compliance with specific rules for Protocol Buffer `(.proto)` files as defined in a YAML configuration file `(rules.yml)`, checking for rule violations and providing feedback for corrections. |
| 67 | + |
| 68 | +## `test_units.py` |
| 69 | + |
| 70 | +Validates the syntax of unit documentation within Protocol Buffer (.proto) files, ensuring that units are documented correctly according to the specified syntax without any enclosing brackets or braces. |
0 commit comments