Commit graph

217 commits

Author SHA1 Message Date
Thibault Saunier
cb0dd804f7 Add support for Gst.Bitmask 2017-07-26 15:27:21 -04:00
Thibault Saunier
fe222637a6 tests: Stop using deprecated assertion methods 2017-07-26 15:27:21 -04:00
Thibault Saunier
9845c91a5f tests: Move all Fundamental types tests in a file
No reason to have one file per type and it makes it more complicated
to handle.
2017-07-26 15:27:21 -04:00
Thibault Saunier
02ddaf29f9 structures: Override __new__ to make it more pythonic 2017-07-26 15:27:19 -04:00
Olivier Crête
24156b0b0d overrides: Remove IntRange And Int64Range on Python2
They use the range() built-in type which is a Python 3 change.

https://bugzilla.gnome.org/show_bug.cgi?id=782927
2017-05-21 18:08:36 +02:00
Nicolas Dufresne
d44975a1fe array/list: Make gvalue conversion symmetric
This is needed to support matrix. Otherwise, getting
a matrix would remove the rows envelopess, which would
make the "cast" fails, since it would not know if the
internal rows are ValueArray or ValueList. I think reading,
modifying and setting back the matrix is an important use
case.
2017-03-27 15:02:41 -04:00
Nicolas Dufresne
a4566ffbc8 overrides: Add more GstValue overrides
This patch adds overrides to support IntRange, Int64Range, DoubleRange,
FractionRange, Array and List. For integer ranges, it maps this
to python 'range'. Gst.IntRange() and Gst.Int64Range() are simple cast
to let the underlying code know which GType to use. To set such range in
python you will do:

  structure["range"] = Gst.IntRange(range(0,10,2)))

Same for the 64 bit variant. And when you do:

  r = structure.get_value("range")

A range will be returned directly, without the wrapper. For DoubleRange
and FractionRange, there is no native support in python. So the usage
will be:

  structure["range"] = Gst.DoubleRange(0,10.0)
  structure["range"] =
      Gst.FractionRange(Gst.Fraction(1/30), Gst.Fraction(1/5)

When getting this value, Gst.DoubleRange and Gst.FractionRange class are
returned. They both have start/stop members. The naming was taken from
range type.

For Array and List, both uses the native list type, though they can be
constructed from any python sequence. So again, the class is just like
a cast, to let it pick the right GType and python list are being
returned.

  structure["list"] = Gst.ValueList([1,2,3,4])
  structure["array"] = Gst.ValueArray([1,2,3,4)

Using string and tuple could also work. Since Gst.ValueList/Array are
sequence, you can convert one to the other with:

  list = Gst.ValueList([1,2,3,4])
  array = Gst.ValueArray (list)

https://bugzilla.gnome.org/show_bug.cgi?id=753754
2017-03-24 13:26:21 -04:00
Thibault Saunier
08d0d09fbd Play nicely with gst-build uninstalled
As overrides_hack is being used as user sitecustomize script
2016-11-04 11:40:10 -03:00
Thibault Saunier
490028ba21 meson: Add testsuite 2016-11-04 11:40:10 -03:00
Thibault Saunier
7b627c499d gst: Fix a crash when passing wrong type as __templates__ 2016-02-15 23:28:47 +01:00
Thibault Saunier
a4bbd96af1 Release 1.5.2 2015-06-24 17:44:30 +02:00
Thibault Saunier
ed1f9eccba tests: Fix tests in python2
Python2 core checks that the first argument of a method is of the type
of the object if it does not have any info about the method, so when
using Gst not initialized it raiser a TypeError and not a
Gst.NotInitialized as expected.

+ And fix a typo
2015-04-24 11:25:38 +02:00
Thibault Saunier
b80ea319cd tests: Add test_fraction back in the testsuite
Properly porting it and adding a small test about getting fraction
from a Gst.Structure
2015-04-24 11:21:44 +02:00
Thibault Saunier
d97662ad41 test: Bring back the testsuite and test if the initialization override works
Summary:
Simplify the Makefile taking example on pitivi and copy several pitivi
testing files, simplifying them a bit for our use case

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D97
2015-04-24 09:17:02 +02:00
Simon Farnsworth
c889037e40 Fix zip code of new FSF address
I missed the zip code last time round - fix it. Thanks to Michael Schwendt
in https://bugzilla.redhat.com/show_bug.cgi?id=1034341#c11 for pointing this
out to me.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=720317
2013-12-12 11:35:41 +00:00
Simon Farnsworth
2ad767a74c Update FSF address
The FSF has moved since these files were created. Update the address, in
order to keep packaging tools such as rpmlint quiet.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=715182
2013-11-26 15:28:53 +00:00
Thibault Saunier
a4b7a67f84 Keep only the testsuite as we are now using GObject Introspection for bindings 2012-07-30 16:24:10 -04:00
Andoni Morales Alastruey
8c60dc788e tests: fix checks when the locale is not the default one
Some tests (test_pbutils.py) checks against strings for the
english locale, so we should force it before running any test

https://bugzilla.gnome.org/show_bug.cgi?id=640207
2011-01-25 13:55:48 +00:00
Edward Hervey
21a885d462 testsuite: Add a make command to run tests forever
And will stop once they fail. Useful to debug racy tests.
2011-01-12 15:01:39 +01:00
Edward Hervey
fd6a936f24 test_pad: Fix pad refcount checking due to fix in core
The event source wasn't previously set correctly. Now that it is,
check the refcount on the proper pad.
2010-12-05 14:09:03 +01:00
Alessandro Decina
a1584d04c5 Fix distcheck some more.
In testsuite/common.py look for gst/__init__.py in builddir now.
Clean gst/__init__.pyc after make check.
2010-11-22 14:18:05 +01:00
Alessandro Decina
dc6b4f7a0a gst.Structure: raise TypeError when assigning None to a key 2010-08-06 23:18:02 +02:00
Alessandro Decina
92a1c11ed3 test_fraction: add a test for gobject property marshalling. 2010-07-26 19:42:39 +02:00
Alessandro Decina
56a725879d gst.GhostPad: allow set_target(None) to unset the target. Fixes #590735. 2010-07-14 12:35:35 +02:00
Thiago Santos
697c8e73f7 tag: Adds xmp functions mappings
Maps gst_tag_list_from_xmp_buffer and
gst_tag_list_to_xmp_buffer

https://bugzilla.gnome.org/show_bug.cgi?id=617068
2010-04-29 16:05:26 +02:00
Edward Hervey
886bcc9599 test_interface: Don't assert the missing mixer, gracefully ignore it
Fixes make check on systems that don't have a GstMixer element available
2010-04-29 16:02:20 +02:00
Sebastian Dröge
60e9fa42a1 build: Make some more rules silent if requested 2010-02-26 16:45:38 +01:00
Jan Schmidt
b0898556bb test: Fix the structure_changed message test
The core changed to use sink pads for the structure changed
message instead of source pads. Might as well fix the test too.
2009-09-11 22:41:28 +01:00
Edward Hervey
7c6041d479 Add test_audio.py. 2009-08-21 16:41:29 +02:00
Sebastian Dröge
aa92fc1bd7 Use LC_ALL=C for the tests as some are comparing localized strings
Fixes bug #590803.
2009-08-08 22:49:16 +02:00
Edward Hervey
7ad1b84f50 gst.Message: Wrap remaining parse_*() methods. 2009-07-01 13:54:57 +02:00
Edward Hervey
eb2aedc523 gst.Message: Add overrides for new 0.10.24 messages 2009-07-01 12:30:59 +02:00
Edward Hervey
f1bbb486ae gst.Event: Add override for step event 2009-07-01 12:30:40 +02:00
Thomas Vander Stichele
26fa6dd184 wrap gst_tag_to_vorbis_comment; fix uint tag setting
Setting gst.TAG_TRACK_NUMBER was failing because GStreamer
expects a uint while Python object -> GValue conversion was
giving an int.  gst_tag_to_vorbis_comment was wrapped so
this conversion could be tested and failed on properly.
2009-06-01 22:02:47 +02:00
Thomas Vander Stichele
88f3323bfe Convert unicode objects to utf-8 encoded G_STRINGs 2009-06-01 19:08:47 +02:00
Edward Hervey
3252c0ee73 testsuite: Dist new test file. 2009-04-23 17:14:20 +02:00
Thomas Vander Stichele
12a210c613 TIME_ARGS: Catch bad input. Fixes #579455 2009-04-23 17:08:04 +02:00
Thomas Vander Stichele
62d82ad5b6 Merge branch 'bz-577735' 2009-04-15 22:38:28 +02:00
Edward Hervey
0a1bfa3ee1 test_adapter: No longer use slices (which was wrong to start with). 2009-04-11 16:49:42 +02:00
Alessandro Decina
1cd54e6d45 Fix uninstalled usage with python 2.6. Fixes #576546
Also imports submodules as mentionned by Philippe Normand.
2009-04-11 16:22:06 +02:00
Thomas Vander Stichele
f99e67aa24 make sure that we actually get the clock-provide message 2009-04-02 18:06:12 +02:00
Thomas Vander Stichele
dd6bf4a4d4 Fix for #577735: do_handle_message leaks messages 2009-04-02 17:21:58 +02:00
Edward Hervey
7aef2834cf New guint8* ArgType. Wraps the various GstAdapter methods. Fixes #576505 2009-03-26 16:13:48 +01:00
Alessandro Decina
0fd4db686b gstbus: fix refcounting in gst.Bus.set_sync_handler. 2009-03-17 15:03:09 +01:00
Edward Hervey
51ac26b86c GstPad: Use gst_pad_set_blocked_async_full() if available.
Avoids leaking arguments.
Fixes #514717
2009-02-22 20:12:23 +01:00
Edward Hervey
3a000ecaa4 Add a rule to generate valgrind suppressions for a single test. 2009-02-09 13:54:50 +01:00
Edward Hervey
3b6ab11761 Raise an Exception when wrapping a NULL GstIterator.
Original commit message from CVS:
* gst/pygstiterator.c: (pygst_iterator_new):
* testsuite/test_iterator.py:
Raise an Exception when wrapping a NULL GstIterator.
Fixes #566903
2009-01-08 12:25:26 +00:00
Edward Hervey
7a2babed30 codegen/argtypes.py: Add handling of 'keep-refcount' for GBoxed arguments.
Original commit message from CVS:
* codegen/argtypes.py:
Add handling of 'keep-refcount' for GBoxed arguments.
* gst/gst.defs:
Mark the appropriate 'gst_message_new_*' arguments when the method
takes the ownership of the passed gst.Structure/gst.TagList
* testsuite/test_message.py:
Test for creating messages that take a gst.Structure/gst.TagList as
argument and make sure they're properly created.
Fixes #556054
2008-12-06 15:41:41 +00:00
Edward Hervey
d658b7b222 testsuite/Makefile.am: Add a way to run individual tests. 'make test_bin.py.check' for example.
Original commit message from CVS:
* testsuite/Makefile.am:
Add a way to run individual tests.
'make test_bin.py.check' for example.
2008-12-06 15:39:01 +00:00
Edward Hervey
a7d29b2f47 testsuite/test_event.py: Sinks now send GST_EVENT_LATENCY events upstream. Adapt test for that new behaviour.
Original commit message from CVS:
* testsuite/test_event.py:
Sinks now send GST_EVENT_LATENCY events upstream. Adapt test for that
new behaviour.
2008-12-06 14:10:51 +00:00