Commit graph

99 commits

Author SHA1 Message Date
Thibault Saunier
70634b1a3f validate: Remove useless condition
CID 1462652

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/192>
2020-06-07 15:47:36 -04:00
Thibault Saunier
66972abafc validate: Give a proper argv[0] when running test files
Fixes CID 1462613

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/192>
2020-06-06 06:00:11 +00:00
Thibault Saunier
b669bb0327 validate: Add support for known-issues in the .validatetest
And add some tests about remaining actions failures

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/189>
2020-05-07 09:36:03 -04:00
Thibault Saunier
af3006dc12 validate: Plug some leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/187>
2020-05-06 22:54:59 +00:00
Thibault Saunier
b65b2bc2fe validate: Add a mechanism to mark tests as skipped
And use it when a plugin is missing and the user didn't ask for
failure when it happens

And use the TAP[0] synthax to report it

[0]: https://testanything.org

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/187>
2020-05-06 22:54:59 +00:00
Thibault Saunier
b1e9e409fd validate: Enhance issue reporting from structures
And properly bail out when required
This is preparatory work for gst-test in core which will use the TAP
protocol

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/187>
2020-05-06 22:54:59 +00:00
Thibault Saunier
0e85d15da0 validate: Add an option to describe issue types
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/185>
2020-04-29 10:13:51 -04:00
Thibault Saunier
66d29a31fd validate: Show the exact file line when error out in structure files
And minor stdout enhancements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/185>
2020-04-29 08:33:21 -04:00
Thibault Saunier
bf952d3c8b 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-27 16:03:33 -04:00
Thibault Saunier
5b52c38b85 validate: Misc leaks plugging 2019-06-18 18:13:03 -04:00
Thibault Saunier
67d4a39602 validate: inspect: Output valid markdown
So it can be used directly in the documentation Also add a special "all"
argument to `gst-validate-1.0 --inspect-action-type` so we can generate
the documentation for all action types easily.
2019-05-13 11:37:38 -04:00
Thibault Saunier
72995d5bbe validate: launcher: Add a way to retrieve trace without coredumpctl
Simply spnning on segfaults (like gst-launch) and catch that in
the launcher to transform the timeout into a segfault and grab a gdb
backtrace
2018-12-07 09:06:50 -03:00
Thibault Saunier
683b19895e validate: Error out if gst_parse_launch sets an error.
https://bugzilla.gnome.org/show_bug.cgi?id=796240
2018-05-18 11:53:40 -04:00
Thibault Saunier
b9d6f9df9e validate: Add a way to print information about pipeline status
Similare to what is done with gst-launch.

And finally generate GTypes for our flags and enums.
2017-07-26 15:45:37 -04:00
Thibault Saunier
edd789cfb7 validate: Recalculate latency on LATENCY messages 2017-06-30 12:32:56 -04:00
Thibault Saunier
8f123cbc6f validate: Make accessing Scenario.pipeline thread safe
The fact that Scenario.pipeline was not accessible in a thread way lead
to the fact that all users had to take the unref the last pipeline ref
in the main thread, otherwise we were crying. This was an ugly
restriction which lead to issue when using scenario on gst-rtsp-server.

This break the API as this commit remove the GstValidateScenario.pipeline
field but it is worth it.
2017-05-31 14:53:05 -04:00
Thibault Saunier
bf71c93e84 tools: Fix dotfile name 2017-04-27 16:46:22 -03:00
Reynaldo H. Verdejo Pinochet
58b3a232b2 validate: fix mention to nonexistent option 2017-02-24 15:59:33 -08:00
Reynaldo H. Verdejo Pinochet
3d13f21be6 validate: improve set-config option description 2017-02-24 15:59:33 -08:00
Reynaldo H. Verdejo Pinochet
b0610dcc9a validate: fix unbalanced quotation mark in set-subtitle description
+ Remove pointless split in string literal
2017-02-17 14:05:00 -08:00
Reynaldo H. Verdejo Pinochet
606ac60704 validate: fix message on runner errors
- Add newline char to avoid accidental concatenation with
  actual error message
- Fix grammar while at it
2017-02-16 14:31:25 -08:00
Jinwoo Ahn
da3880d6d0 validate: fix typo
https://bugzilla.gnome.org/show_bug.cgi?id=772543
2016-10-07 08:16:45 +01:00
Reynaldo H. Verdejo Pinochet
6a990a2a71 validate: fix grammar on subtitle-file action description 2016-09-25 18:03:45 -07:00
Guillaume Desmottes
15e5e23e32 validate: use new API when switching track with playbin3
Move all the implementations of 'switch-track' to
gst-validate-scenario.c while doing so.

Differential Revision: https://phabricator.freedesktop.org/D1227
2016-08-01 10:45:42 -04:00
Guillaume Desmottes
04282bb192 validate: call gst_deinit() after gst_validate_deinit()
This allows validate to clean up before the 'leak' tracer list leaked
objects.

Reviewed-by: Thibault Saunier <tsaunier@gnome.org>
Differential Revision: https://phabricator.freedesktop.org/D1231
2016-08-01 10:45:36 -04:00
Guillaume Desmottes
5b78110813 validate: fix pad leaks
Pads returned using the playbin get-{audio,video}-pad are reffed.

Reviewed-by: Thibault Saunier <tsaunier@gnome.org>
Differential Revision: https://phabricator.freedesktop.org/D1027
2016-08-01 10:45:32 -04:00
Guillaume Desmottes
dc7382017d validate: reporter: break cyclic references with reports
My patch fixing monitor leak (15e7f1bbfd)
introduced a ref cycle between GstValidateReporter and
GstValidateReport.

The reports uses its reporter so it needs a ref on it
to ensure it's stay alive. But reports are owned by GstValidateReporter and/or
GstValidateRunner.
The best way I found to break this cycle is to introduce this purge
method. It's not great but the design is a bit tricky.

Reviewed-by: Thibault Saunier <tsaunier@gnome.org>
Differential Revision: https://phabricator.freedesktop.org/D1029
2016-08-01 10:45:30 -04:00
Edward Hervey
e5f381b96a validate: Use presence of STREAM_START to detect track switching
When doing a track switch, the only reliable way to detect that it
happened is whether a new STREAM_START arrives.
Relying on a DISCONT buffer is not satisfactory, since there might
not have been an element setting that flag upstream.

Checking whether the first buffer after a STREAM_START has the
DISCONT flag properly set should be done in parallel
2016-06-30 14:58:03 +02:00
Edward Hervey
0799397768 tools: Make the stream-switching action more generic
This allows it to handle both playbin and playbin3
2016-06-30 14:58:03 +02:00
Edward Hervey
b413f3a404 tools: Fix playbin detection
We might be using playbin3 instead
2016-06-30 14:58:03 +02:00
Reynaldo H. Verdejo Pinochet
14a9dab346 validate: improve run-time option descriptions 2016-06-09 14:31:48 -07:00
Edward Hervey
0711d4e163 gst-validate: Avoid overreading array
If we offset the argv table as argument, we need to decrement the number
of items in the array (argc) when iterating it
2016-05-19 12:07:57 +02:00
Thibault Saunier
621bda9b62 validate: Use GstValidate logging system to print buffering avancement
So it can be used in the launcher.
And make sure to properly parse the info in the launcher.
2016-03-21 14:34:27 +01:00
Thibault Saunier
3657e7867f validate: Namespace all our structures and objects
Making GI a bit happier.

Those are not stable API anyway...

Differential Revision: https://phabricator.freedesktop.org/D704
2016-02-23 11:46:58 +01:00
Thibault Saunier
8c760b0a0e validate: Turn GstValidateRunner into a GstTracer
This way we do not need the LD_PRELOAD hack anymore

Add a new libgstvalidateplugin GStreamer plugin, making sure it shares
the exact same code as the library (exposing only the wanted symbols).

Fix the way we set where to install GstValidate plugins

Try to keep backward compatibility even if tracers should never be instantiated
after an GstElement has been instantiated.

Differential Revision: https://phabricator.freedesktop.org/D459
2016-02-23 11:46:32 +01:00
Edward Hervey
4e2c7af46c tools: Fix relative track switching
I have no idea where that "-2" came from, but it was obviously wrong.
Just use modulo "total number of streams" to get the proper track id.
2016-01-21 14:30:46 +01:00
Vineeth T M
d57fca241a validate: Fix memory leaks when context parse fails
When g_option_context_parse fails, context and error variables are not getting free'd
which results in memory leaks. Free'ing the same.

And replacing g_error_free with g_clear_error, which checks if the error being passed
is not NULL and sets the variable to NULL on free'ing.

https://bugzilla.gnome.org/show_bug.cgi?id=753862
2015-11-11 10:12:49 +01:00
Vineeth TM
5c0c42ed6d validate:tools: set locale to all and change argument to FILENAME
When file name consists of characters from other languages, say korean,
then it throws an error
Error initializing: Invalid byte sequence in conversion input

Hence setting locale to all to fix this.
And changing the media-info argument to type G_OPTION_ARG_FILENAME

https://bugzilla.gnome.org/show_bug.cgi?id=753486
2015-10-02 17:32:19 +02:00
Sebastian Dröge
403b236426 validate: Don't override the target state of the scenario when receiving BUFFERING=100%
If the scenario handles the states and wants to stay in PAUSED, it's not a
good idea to change the state to PLAYING when receiving BUFFERING=100%. This
caused a race condition in varios seeking tests, most often in the dash scrub
seeking test.
2015-08-17 14:27:33 +02:00
Vineeth TM
c91ed016b1 validate:tools: set locale to all and change argument to FILENAME
When file name consists of characters from other languages, say korean,
then it throws an error
Error initializing: Invalid byte sequence in conversion input

Hence setting locale to all to fix this.
And changing the media-info argument to type G_OPTION_ARG_FILENAME

https://bugzilla.gnome.org/show_bug.cgi?id=752945
2015-07-30 14:06:41 +01:00
Thibault Saunier
dfe29c56e5 validate🏃 Add a method to force exiting the runner
This method is similar to runner_printf() but can be used
only once. The user needs to make sure all the pipeline
are in NULL state when this is called.

The method emits a "STOPPING" signal and at that point
overrides or monitors should do extra processing/checks if
needed.

+ Make use of it everywhere where it makes sense.

API:
  gst_validate_runner_exit
  GstValidateRunner::stopping signal
2015-06-06 08:50:47 +02:00
Guillaume Desmottes
92fa2b5681 validate: add gst_validate_deinit()
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D159
2015-05-11 21:55:24 +02:00
Thibault Saunier
101ed96b5a validate:tools: EOS handling is the responsibility of the scenario
Summary: If any scenario set

Reviewers: Mathieu_Du

Differential Revision:
http://phabricator.freedesktop.org/D90
2015-04-13 11:27:08 +02:00
Guillaume Desmottes
5456ddbae0 call gst_deinit() when we are done
More valgrind friendly.
2015-03-23 13:41:03 +01:00
Guillaume Desmottes
a35614d108 validate: call gst_bus_remove_signal_watch()
We are supposed to call gst_bus_remove_signal_watch() for each gst_bus_add_signal_watch() call to prevent leaks.
2015-03-23 13:41:03 +01:00
Guillaume Desmottes
08a9034576 validate: fix string arguments leaks
We are responsible of freeing the string arguments parsed by GOptionContext.
2015-03-20 12:15:03 +01:00
Thibault Saunier
bee292f548 validate: Wait for switch-track to complete before executing next action
This action type can take some time, we need to make sure that the
combiner/input-selector element properly pushed a buffer marked
as DISCONT to concider the action is done.

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:08 +01:00
Thibault Saunier
1bc32a888f validate: Avoid assert removing an already removed signal handler
And, make sure that we set the return value != 0 when we receive
SIGINT
2014-12-05 20:51:44 +01:00
Thibault Saunier
130a2892b1 validate: print execution of set_subtitles actions 2014-12-05 19:23:43 +01:00
Thibault Saunier
c5dfd9c8c8 validate: Add a way to pass a MediaDescriptor around monitors
And add an option in gst-validate so that the user can define what
media descriptor file to use.

https://bugzilla.gnome.org/show_bug.cgi?id=736138
2014-10-21 20:14:05 +02:00