We do not have a way to know the format modifiers to use with string
functions provided by the system. `G_GUINT64_FORMAT` and other string
modifiers only work for glib string formatting functions. We cannot
use them for string functions provided by the stdlib. See:
https://developer.gnome.org/glib/stable/glib-Basic-Types.html#glib-Basic-Types.description
```
../validate/plugins/flow/formatting.c: In function 'format_number':
../validate/plugins/flow/formatting.c:68:22: error: unknown conversion type character 'l' in format [-Werror=format=]
sprintf (dest_str, "%" G_GUINT64_FORMAT, number);
^~~
In file included from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib/gtypes.h:32,
from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib/galloca.h:32,
from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib.h:30,
from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/gstreamer-1.0/gst/gst.h:27,
from ../validate/plugins/flow/formatting.h:26,
from ../validate/plugins/flow/formatting.c:30:
/builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/lib/glib-2.0/include/glibconfig.h:69:28: note: format string is defined here
#define G_GUINT64_FORMAT "llu"
^
../validate/plugins/flow/formatting.c:68:22: error: too many arguments for format [-Werror=format-extra-args]
sprintf (dest_str, "%" G_GUINT64_FORMAT, number);
^~~
../validate/plugins/flow/formatting.c:68:22: error: unknown conversion type character 'l' in format [-Werror=format=]
In file included from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib/gtypes.h:32,
from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib/galloca.h:32,
from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib.h:30,
from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/gstreamer-1.0/gst/gst.h:27,
from ../validate/plugins/flow/formatting.h:26,
from ../validate/plugins/flow/formatting.c:30:
/builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/lib/glib-2.0/include/glibconfig.h:69:28: note: format string is defined here
#define G_GUINT64_FORMAT "llu"
^
../validate/plugins/flow/formatting.c:68:22: error: too many arguments for format [-Werror=format-extra-args]
sprintf (dest_str, "%" G_GUINT64_FORMAT, number);
^~~
```
Needed for https://gitlab.freedesktop.org/gstreamer/cerbero/merge_requests/419
Get a sense of files and line numbers in the parsed GstStructure
and take that information when reporting GstValidateAction errors
by letting the user know where the action comes from in the messages.
And accept non-literal string in printing formats.
Since `,` is the separator between fields of GstStructure we can
safely consider that if a line ends with it, the following line
is the logical continuity of the serialized GstStructure.
This makes writing those files more convenient and reading them
more pleasant as we do not need to add extra `\` at end of lines
anymore
When generating tests from dictionary the dict format allows passing
several scenario for a same config and pipelines, but this was breaking
the case where expected flow is different with each config, instead we
should generate one config per scenario, fixing the expectation files
generated.
Added two properties to the plugin:
* ignored-event-types: A list of event types to be ignored when logging events
* logged-event-types: A list of event types to be logged when logging events
This commits also moves the "ignored-event-fields" property to using a proper
GstValueList for the list of event fields to be taken into account, instead
of the home grown separated by comas list of string, making the API more
uniform.
This also adds a simple helper method: `gst_validate_utils_get_strv`
This introduce new command line options, --parts and --part-index. When
--parts is set to a value larger then 1, the tests will be split in the
same number of group. The group number identified by --part-index will
be executed.
This is being added in orther to support gliblab CI parallel feature.
It is not safe for `_preformat_levels` to assume that all of the fields in a
`TerminalController` have the same type; at least in my environment, some of
these fields are populated with `bytes` while others remain strings.
This change conditionally applies decoding to each control sequence separately
using a helper function `_as_string`. As a side-effect, it also eliminates some
code repetition in `_preformat_levels`.
Closes#50.
The colon character commonly used to separate the element name and the
pad name is reserved in Windows filesystems, so it's better to use
something safer.
This patch replaces it with '-'. Please update
gst-integration-testsuites too where another commit has renamed all the
files.
`gst_pad_pull_range` should always be called from the streaming thread,
we now check that when pull_range is called, and if the sinkpad calling
the function has a GstTask with a running thread, the function is called
from that thread.
In file included from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gst.h:55,
from ../validate/gst/validate/gst-validate-scenario.c:45:
../validate/gst/validate/gst-validate-scenario.c: In function ‘gst_validate_scenario_load’:
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstinfo.h:645:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
645 | gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
646 | (GObject *) (object), __VA_ARGS__); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstinfo.h:1067:26: note: in expansion of macro ‘GST_CAT_LEVEL_LOG’
1067 | #define GST_ERROR(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
| ^~~~~~~~~~~~~~~~~
../validate/gst/validate/gst-validate-scenario.c:3615:5: note: in expansion of macro ‘GST_ERROR’
3615 | GST_ERROR ("Invalid name for scenario '%s'", scenario_name);
| ^~~~~~~~~
../validate/gst/validate/gst-validate-scenario.c:3615:44: note: format string is defined here
3615 | GST_ERROR ("Invalid name for scenario '%s'", scenario_name);
| ^~
../validate/plugins/flow/gstvalidateflow.c:75:3: error: redefinition of typedef 'ValidateFlowOverride' is a C11 feature [-Werror,-Wtypedef-redefinition]
} ValidateFlowOverride;
^
../validate/plugins/flow/gstvalidateflow.h:31:23: note: previous definition is here
G_DECLARE_FINAL_TYPE (ValidateFlowOverride, validate_flow_override,
^
[3470/4053] Compiling C object 'subprojects/gst-devtools/validate/gst/validate/28db7b6@@gstvalidatetracer@sha/gst-validate-reporter.c.o'.
../subprojects/gst-devtools/validate/gst/validate/gst-validate-reporter.c:186:31: warning: format string is not a string literal [-Wformat-nonliteral]
message = g_strdup_vprintf (format, vacopy);
^~~~~~
[3487/4053] Compiling C object 'subprojects/gst-devtools/validate/gst/validate/28db7b6@@gstvalidatetracer@sha/gst-validate-report.c.o'.
../subprojects/gst-devtools/validate/gst/validate/gst-validate-report.c:1007:34: warning: format string is not a string literal [-Wformat-nonliteral]
tmp = gst_info_strdup_vprintf (format, args);
^~~~~~
[76/151] Compiling C object 'subprojects/gst-devtools/validate/plugins/flow/697521d@@gstvalidateflow@sha/gstvalidateflow.c.o'.
../subprojects/gst-devtools/validate/plugins/flow/gstvalidateflow.c:125:65: warning: format string is not a string literal [-Wformat-nonliteral]
if (!flow->error_writing_file && vfprintf (flow->output_file, format, ap) < 0) {
^~~~~~
Pipelines declared in gst-integration-testsuites can rely on the validate HTTP
server, so when an URI pointing to it is detected, advertise the server as
needed before starting the test.
For this to work the test scenario should explicitely declare the pipeline uri,
as shown in this example:
"some_playbin3":
{
"pipeline": "playbin3 uri=%(uri)s video-sink=%(videosink)s",
"config": [
"%(validateflow)s, pad=sink:sink"
],
"scenarios": ["play_15s"],
"uri": "http://127.0.0.1:%(http-server-port)s/defaults/html/foo.html"
}
This means that we can now pass any extra key that `populate_tests`
expects, meaning any key expected by FakeMediaDescriptor and
a few other keys supported by the methods such as
`expected-issues` and `extra_env_vars`
The way this was implemented was simply wrong, first of all checking
the position against the segment after a seek in PAUSED by a query
of the pipeline position is of limited interest, and can only work
in forward playback.
Furthermore the check was a huge blob of code that didn't even look
like it was pretending to do a good job at checking the position in
reverse playback.
This also adds the notion of global variables which will be useable
in config files too.
And add some documentation about default variables in scenarios
Meaning that instead of getting 1 "Detected on" line per monitor,
there will be one per "branch" like:
Detected on <audioconvert1:sink, audioconvert1:src, audioresample1:sink, audioresample1:src, smart-adder-adder:sink_0, smart-adder-adder:src, smart-adder-capsfilter:sink, smart-adder-capsfilter:src, capsfilter2:sink, capsfilter2:src, tee1:sink, tee1:src_0>
Making it simpler to read and a bit less verbose.
The action is generally useful but was implemented in a way that
was restricting its usage for no good reason. Refactor the
implementation adding more argument so it can be used in a wider
context, such as uvch264src.
Something like:
``` bash
echo "video-request-key-unit, direction=upstream, all-header=true, count=1, target-element-factory-name=h264parse, srcpad=src, playback-time=1.0" > tmp.scenario && \
echo "stop,playback-time=2.0" >> tmp.scenario && \
gst-validate-1.0 --set-scenario=tmp.scenario uvch264src \
device=/dev/video0 name=src iframe-period=33 auto-start=true src.vfsrc ! queue ! fakesink \
src.vidsrc ! queue ! video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse ! fakesink
```
works now.