validate: Introduce the concept of "Test files"
This way we can have a single file that wraps scenarios,
`gst-validate-1.0` arguments, as well as a configuration.
It changes the name of `description` of scenarios to use `meta`
The goal is to replace tests describes in python with dictionary
to fully self contained `.validatetest` files which look like:
```
meta,
handles-states=true,
ignore-eos=true,
gst-validate-args = {
"videotestsrc pattern=blue ! video/x-raw,format=I420,framerate=1/1 ! timeoverlay ! $(videosink) name=videosink allocation-meta-flags=0",
},
configs = {
"$(validateflow), pad=videosink:sink, buffers-checksum=true, ignored-fields={\"buffers=meta\", }",
}
play
seek, start=0.0, stop=5.0, flags=accurate+flush, rate=1.0
crank-clock, expected-elapsed-time=0.0
crank-clock, repeat=4, expected-elapsed-time=1.0
crank-clock, expected-elapsed-time=1.0
stop, on-message=eos
```
2020-04-24 19:41:10 +00:00
|
|
|
---
|
|
|
|
title: Test file
|
|
|
|
short-description: GstValidate test file
|
|
|
|
...
|
|
|
|
|
|
|
|
# GstValidate Test file
|
|
|
|
|
|
|
|
A `.validatetest` file describes a fully contained validate test case. It
|
|
|
|
includes the arguments of the tool supposed to be used to run the test as well
|
|
|
|
as possibly a [configuration](gst-validate-config.md) and a set of action to
|
|
|
|
describe the validate [scenario](gst-validate-scenarios.md).
|
|
|
|
|
|
|
|
# The file format
|
|
|
|
|
2023-12-12 17:59:32 +00:00
|
|
|
A validate test file requires a [`meta`](gst-validate-action-types.md?#meta) structure describing
|
|
|
|
the test and configuring it. The `meta` structure should be either the
|
validate: Introduce the concept of "Test files"
This way we can have a single file that wraps scenarios,
`gst-validate-1.0` arguments, as well as a configuration.
It changes the name of `description` of scenarios to use `meta`
The goal is to replace tests describes in python with dictionary
to fully self contained `.validatetest` files which look like:
```
meta,
handles-states=true,
ignore-eos=true,
gst-validate-args = {
"videotestsrc pattern=blue ! video/x-raw,format=I420,framerate=1/1 ! timeoverlay ! $(videosink) name=videosink allocation-meta-flags=0",
},
configs = {
"$(validateflow), pad=videosink:sink, buffers-checksum=true, ignored-fields={\"buffers=meta\", }",
}
play
seek, start=0.0, stop=5.0, flags=accurate+flush, rate=1.0
crank-clock, expected-elapsed-time=0.0
crank-clock, repeat=4, expected-elapsed-time=1.0
crank-clock, expected-elapsed-time=1.0
stop, on-message=eos
```
2020-04-24 19:41:10 +00:00
|
|
|
first or the one following the `set-globals` structure. The `set-globals`
|
|
|
|
structures allows you to set global variables for the rest of the
|
|
|
|
`.validatetest` file and is a free form variables setter. For example you can
|
|
|
|
do:
|
|
|
|
|
|
|
|
``` yaml
|
|
|
|
set-globals, media_dir=$(test_dir)/../../media
|
|
|
|
```
|
|
|
|
|
|
|
|
## Tool arguments
|
|
|
|
|
2020-04-13 20:23:32 +00:00
|
|
|
In the case of [`gst-validate`](gst-validate.md) it **has to** contain an
|
|
|
|
`args` field with `gst-validate` argv arguments like:
|
validate: Introduce the concept of "Test files"
This way we can have a single file that wraps scenarios,
`gst-validate-1.0` arguments, as well as a configuration.
It changes the name of `description` of scenarios to use `meta`
The goal is to replace tests describes in python with dictionary
to fully self contained `.validatetest` files which look like:
```
meta,
handles-states=true,
ignore-eos=true,
gst-validate-args = {
"videotestsrc pattern=blue ! video/x-raw,format=I420,framerate=1/1 ! timeoverlay ! $(videosink) name=videosink allocation-meta-flags=0",
},
configs = {
"$(validateflow), pad=videosink:sink, buffers-checksum=true, ignored-fields={\"buffers=meta\", }",
}
play
seek, start=0.0, stop=5.0, flags=accurate+flush, rate=1.0
crank-clock, expected-elapsed-time=0.0
crank-clock, repeat=4, expected-elapsed-time=1.0
crank-clock, expected-elapsed-time=1.0
stop, on-message=eos
```
2020-04-24 19:41:10 +00:00
|
|
|
|
|
|
|
``` yaml
|
|
|
|
# This is the default tool so it is not mandatory for the `gst-validate` tool
|
|
|
|
tool = "gst-validate-$(gst_api_version)",
|
|
|
|
args = {
|
|
|
|
# pipeline description
|
|
|
|
videotestrc num-buffers=2 ! $(videosink),
|
|
|
|
# Random extra argument
|
|
|
|
--set-media-info $(test-dir)/some.media_info
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-12-12 17:59:32 +00:00
|
|
|
## Variables
|
validate: Introduce the concept of "Test files"
This way we can have a single file that wraps scenarios,
`gst-validate-1.0` arguments, as well as a configuration.
It changes the name of `description` of scenarios to use `meta`
The goal is to replace tests describes in python with dictionary
to fully self contained `.validatetest` files which look like:
```
meta,
handles-states=true,
ignore-eos=true,
gst-validate-args = {
"videotestsrc pattern=blue ! video/x-raw,format=I420,framerate=1/1 ! timeoverlay ! $(videosink) name=videosink allocation-meta-flags=0",
},
configs = {
"$(validateflow), pad=videosink:sink, buffers-checksum=true, ignored-fields={\"buffers=meta\", }",
}
play
seek, start=0.0, stop=5.0, flags=accurate+flush, rate=1.0
crank-clock, expected-elapsed-time=0.0
crank-clock, repeat=4, expected-elapsed-time=1.0
crank-clock, expected-elapsed-time=1.0
stop, on-message=eos
```
2020-04-24 19:41:10 +00:00
|
|
|
|
|
|
|
Validate testfile will define some variables to make those files relocable:
|
|
|
|
|
|
|
|
* `$(test_dir)`: The directory where the `.validatetest` file is in.
|
|
|
|
|
|
|
|
* `$(test_name)`: The name of the test file (without extension).
|
|
|
|
|
|
|
|
* `$(test_name_dir)`: The name of the test directory (test_name with folder
|
|
|
|
separator instead of `.`).
|
|
|
|
|
|
|
|
* `$(validateflow)`: The validateflow structure name with the default/right
|
|
|
|
values for the `expectations-dir` and `actual-results-dir`
|
2020-06-03 18:29:22 +00:00
|
|
|
fields. See [validateflow](gst-validate-flow.md) for more
|
validate: Introduce the concept of "Test files"
This way we can have a single file that wraps scenarios,
`gst-validate-1.0` arguments, as well as a configuration.
It changes the name of `description` of scenarios to use `meta`
The goal is to replace tests describes in python with dictionary
to fully self contained `.validatetest` files which look like:
```
meta,
handles-states=true,
ignore-eos=true,
gst-validate-args = {
"videotestsrc pattern=blue ! video/x-raw,format=I420,framerate=1/1 ! timeoverlay ! $(videosink) name=videosink allocation-meta-flags=0",
},
configs = {
"$(validateflow), pad=videosink:sink, buffers-checksum=true, ignored-fields={\"buffers=meta\", }",
}
play
seek, start=0.0, stop=5.0, flags=accurate+flush, rate=1.0
crank-clock, expected-elapsed-time=0.0
crank-clock, repeat=4, expected-elapsed-time=1.0
crank-clock, expected-elapsed-time=1.0
stop, on-message=eos
```
2020-04-24 19:41:10 +00:00
|
|
|
information.
|
|
|
|
|
|
|
|
* `$(videosink)`: The GStreamer videosink to use if the test can work with
|
|
|
|
different sinks for the video. It allows the tool to use
|
|
|
|
fakesinks when the user doesn't want to have visual feedback
|
|
|
|
for example.
|
|
|
|
|
|
|
|
* `$(audiosink)`: The GStreamer audiosink to use if the test can work with
|
|
|
|
different sinks for the audio. It allows the tool to use
|
|
|
|
fakesinks when the user doesn't want to have audio feedback
|
2020-05-27 03:25:48 +00:00
|
|
|
for example.
|