Skip to content
Snippets Groups Projects
Commit d66abf60 authored by Luis Araujo's avatar Luis Araujo
Browse files

Explain parser behaviour and format rules


Explain some of the format rules and parser behaviour
in the README file.

This commit also fixes a minimal typo in the render-test-case
comments.

Signed-off-by: default avatarLuis Araujo <luis.araujo@collabora.co.uk>
parent 27233b71
No related branches found
No related tags found
No related merge requests found
Repository for Apertis tests cases.
# Apertis Tests Cases and Renderer
This repository contains all the Apertis test cases written using the YAML format
defined at the `format/` directory.
The repository also contains the `renderer-test-case` program, which is used to
generate the test case pages in HTML format from the YAML files.
## Format Rules/Notes
- The renderer heavily uses `lists` of strings to parse those into the different
HTML components. Each string in a list can be started with a special character
to get a specific format if it is supported by the YAML directive containing
such a string.
For the `pre-conditions`, `notes`, `expected`, `run.steps` (only manual
tests) and `post-conditions` directives, start a line with the following
characters to give the described format:
- `$`: Command line.
- `>`: Command output.
- `@`: Attach image.
- `~`: Add a web link.
For the `run.steps` field in the automated tests, only the following formatting
rules apply:
- `#`: Add a comment.
- Everything else is a command line.
- Test cases with an `install.deps` directive will automatically add a
`pre conditions` section to the test case page with the list of packages to
`pre-conditions` section to the test case page with the list of packages to
install specified in such a directive.
## Macro helpers
......@@ -13,7 +39,7 @@ available: `macro_ostree_preconditions` , `macro_install_packages_preconditions`
and `macro_modules_preconditions`. Please check the tests cases for example about
how to use them.
## Command
## Renderer
The main program is located inside the `renderer/` subdirectory and can be directly
invoked from inside that directory:
......@@ -44,3 +70,14 @@ $ ./render-test-case ../tests-cases/ -d apertis-tests-cases-v0.1/
Now all the html tests cases should be available inside the
`apertis-tests-cases-v0.1/` directory.
### Renderer (parser) behaviour
- The renderer parser will always abort with a failure if a mandatory field is
missing.
- The renderer parser will abort with a failure for those fields set to values
with incorrect types.
- The renderer parser will show warning messages for unrecognized values of
fields with multiple choices (for example, image-type, execution-type).
......@@ -103,7 +103,7 @@ def get_template_values(testcase_data):
if mv == 'expected':
template_values.update({ mv : parse_list(value) })
else:
# Set also the prority_color
# Set the priority_color.
if mv == 'priority':
template_values.update({ 'priority_color' :
priority_color(value) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment