Commit graph

75 commits

Author SHA1 Message Date
Tim-Philipp Müller
ac8d5cac4e check: optionally check env var for us to make sure test env is set up
If GST_CHECK_TEST_ENVIRONMENT_BEACON is defined, check if the
environment variable it is defined to is set up at the start
of each test.

https://bugzilla.gnome.org//show_bug.cgi?id=747624
2015-04-23 15:54:08 +01:00
Mathieu Duponchelle
0ee2183aa5 check: cast element in ASSERT_SET_STATE.
https://bugzilla.gnome.org/show_bug.cgi?id=744777
2015-02-19 12:18:50 +01:00
Sebastian Rasmussen
85c8b5d2c4 check: Apply GStreamer-specific patches
Reintroduced patches:

 * Make sure that fail_if(1) actually fails
   from commit 9f99d056a2

New patches due to updated libcheck (based on 0.9.14):

 * Checks in m4/check-checks.m4 to cater for new dependencies
 * Conditional compile-time compat POSIX fallbacks for libcheck
 * Avoid relative paths for libcheck header files
 * Make timer_create() usage depend on posix timers, not librt
 * Rely on default AX_PTHREAD behavior to allow HAVE_PTHREAD to be used
   when checking for types and functions (like clock_gettime())
 * Avoid double declaration of clock_gettime() when availabe outside of
   librt by making compat clock_gettime() declaration conditional
 * check 0.9.9 renamed _fail_unless() and 0.9.12 later renamed it again
   to _ck_assert_failed(), so ASSERT_{CRITICAL,WARNING}() now calls this
   function
 * Remove libcheck fallback infrastructure for malloc(), realloc(),
   gettimeofday() and snprintf() since either they appear to be
   available or they introduce even more dependencies.

The result is an embedded check in gstreamer that has been tested by
running check tests in core, -base, -good, -bad, -ugly and rtsp-server
on Linux, OSX and Windows.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727826
2014-12-06 17:48:25 +01:00
Sebastian Dröge
154eefecc9 Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.

Also normalize booleans in a few places.
2014-12-01 09:51:37 +01:00
Thibault Saunier
87a79673b0 check: Add a function to check destruction of objects
Add a method letting people to ensure that unreffing one object
leads to its destruction, and possibly the destruction of more object
(think destruction of a GstBin etc...).

https://bugzilla.gnome.org/show_bug.cgi?id=736477
2014-09-12 17:18:21 +02:00
Tim-Philipp Müller
ba31faf261 libs: gstcheck: check that mutex is locked before g_cond_wait*() is called
Sanity check to catch problems in unit test.
2014-07-06 12:13:04 +01:00
Tim-Philipp Müller
b2bbd1edfa libs: gstcheck: init and clear global mutex and cond variables 2014-07-06 12:12:20 +01:00
Sebastian Dröge
917a033d04 check: Add new API to set up pads from non-static pad templates 2014-04-15 12:58:59 +02:00
Stefan Sauer
6fc23cd016 check: also use the glob on GST_CHECKS when forcing to run broken tests
GST_CHECKS can be simply "test*" to run run all tests (including those that are
marked broken). Update the sparse comments a bit to tell how this works.
2014-02-19 11:04:17 +01:00
Olivier Crête
75aa2bd86f check: Change stream_id parameter name to match GtkDoc 2013-07-01 20:07:03 -04:00
Jonas Holmberg
0ea8748c6b check: Added gst_check_setup_events_with_stream_id()
Added a new function gst_check_setup_events_with_stream_id(), since
gst_check_setup_events() does not work with multiple pads.

https://bugzilla.gnome.org/show_bug.cgi?id=703377
2013-07-01 15:54:11 +02:00
Nicolas Dufresne
a1866e64c5 check: Add helper that sends initial events
https://bugzilla.gnome.org/show_bug.cgi?id=700033
2013-05-10 09:23:28 +02:00
Tim-Philipp Müller
e2b09b1ab9 check: run skipped tests if explicitly requested via GST_CHECKS
If a test that's disabled with tcase_skip_broken_test() is listed
in the GST_CHECKS environment variable, run it anyway.
2013-04-18 00:19:23 +01:00
Tim-Philipp Müller
22b7c0bf58 check: add some more fail_unless_*() macros for convenience
API: fail_unless_equals_int_hex
API: assert_equals_int_hex
API: fail_unless_equals_int64_hex
API: assert_equals_int64_hex
API: fail_unless_equals_uint64_hex
API: assert_equals_uint64_hex
API: fail_unless_equals_pointer
API: assert_equals_pointer
2013-02-19 17:40:20 +00:00
Sebastian Dröge
e58dabc750 libs: Use foo/foo.h as single-include header consistently everywhere
https://bugzilla.gnome.org/show_bug.cgi?id=688785
2012-12-12 16:44:14 +00:00
Evan Nemerson
1afb1f12ef libs: Add missing single include headers and use them in GIRs 2012-11-21 11:00:40 +01:00
Tim-Philipp Müller
666c8c11c6 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 20:44:48 +00:00
Tim-Philipp Müller
7eb64ad7a9 check: fix FIXME printing for tcase_skip_broken_test() 2012-09-23 19:56:43 +01:00
Mark Nauwelaerts
9454c8c626 check: remove glib deprecation compatibility trickery 2012-09-12 13:02:06 +02:00
Mark Nauwelaerts
bb4860d961 check: port to the new GLib thread API 2012-09-12 13:01:18 +02:00
Tim-Philipp Müller
c0f1ff5f79 check: add tcase_skip_broken_test() define
Skips broken tests but logs an ERROR-level message to
draw attention to that fact.
2012-08-05 17:16:27 +01:00
Edward Hervey
d3ffa82639 Remove 0.10-related documentation and "Since" markers 2012-07-10 12:03:27 +02:00
Wim Taymans
a1c5b00e72 memory: make GstMemory a miniobject 2012-06-14 16:34:28 +02:00
Olivier Crête
8f8335a7f4 check: Update gst_check_element_push_buffer to 0.11 style caps
Pass the desired caps explicitely
2012-01-28 16:42:38 +00:00
Wim Taymans
ad659abe8e check: add macro to check for memory refcount 2012-01-05 13:09:29 +01:00
Tim-Philipp Müller
eaa2d81474 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	gst/gstindexfactory.c
	libs/gst/base/gstbasetransform.c
	plugins/elements/gstfakesink.c
	plugins/elements/gstfakesrc.c
	plugins/elements/gstidentity.c
	plugins/elements/gstinputselector.c
	plugins/elements/gstoutputselector.c

Note: did not merge any of the basetransform changes from 0.10.
2011-12-08 00:39:10 +00:00
Tim-Philipp Müller
8811cbc5aa check: allow non-joinable threads in private g_thread_create() copy
Looks like some tests use non-joinable threads after all.
2011-12-04 21:20:07 +00:00
Tim-Philipp Müller
a1daf846f3 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	gst/gstobject.h
	libs/gst/check/gstcheck.h
	libs/gst/controller/gstcontroller.c
	plugins/elements/gstidentity.c
	tools/gst-xmlinspect.c
2011-12-04 15:38:09 +00:00
Tim-Philipp Müller
5889260d5a Work around deprecated thread API in glib master
Add private replacements for deprecated functions such as
g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly
to avoid the deprecation warnings. We can't change most of
these in 0.10 because they're part of our API and ABI.
2011-12-04 13:35:38 +00:00
Tim-Philipp Müller
ca179625f8 g_thread_create() is deprecated in GLib master, use g_thread_try_new() instead 2011-12-03 13:58:51 +00:00
René Stadler
f6e992cb06 check: drop caps argument from gst_check_setup_{src,sink}_pad
Calling set_caps at that point is not useful in 0.10 (FIXME comment!), and in
0.11 it is totally pointless: the caps event doesn't stick to a flushing pad.
2011-11-24 21:43:31 +01:00
Wim Taymans
612b1fbb14 pad: add parent to other functions
Add parent to chain, chain_list, getrange and event functions.
2011-11-17 12:40:45 +01:00
Wim Taymans
841ad590b9 .h: fix header files
Ensure correct indentation and retab
Make sure all structure have padding
2011-11-11 17:30:03 +01:00
Edward Hervey
acd905d78a gstcheck: Make ASSERT_MINI_OBJECT_REFCOUNT more useful
knowing which miniobject failed helps us locate it in debug logs
2011-10-17 09:51:15 +02:00
Wim Taymans
b0fad063b5 Merge branch 'master' into 0.11 2011-05-24 17:43:36 +02:00
Debarshi Ray
f9a4dcd074 check: add fail_unless_equals_int64
https://bugzilla.gnome.org/show_bug.cgi?id=650973
2011-05-24 16:21:20 +02:00
Wim Taymans
826a7d83d4 buffer: more fixes 2011-03-28 20:08:47 +02:00
Edward Hervey
8c2481dd57 check: Use g_strcmp0 instead of strcmp
Avoids segfaults when using NULL arguments.
2010-08-30 12:48:40 +02:00
Stefan Kost
5d0015048b check: don't use c++ keywords as variable names 2010-08-05 10:31:50 +03:00
Benjamin Otte
7e7f51f617 Fixes for -Wmissing-declarations -Wmissing-prototypes
Also adds those flags to the configure warning flags

https://bugzilla.gnome.org/show_bug.cgi?id=611692
2010-03-11 10:59:57 +01:00
Benjamin Otte
a9d1a493a7 Fixes for -Wwrite-strings
This changes some APIs in compatible ways:
- Some functions now take "const char *" arguments, not "char *"
- Some structs now have "conts char *" members, not "char *"
The changes may cause warnings when compiling with the right warning
flags. You've been warned.

Also adds -Wwrite-strings as a warning flag in configure.ac.

https://bugzilla.gnome.org/show_bug.cgi?id=611692
2010-03-10 20:50:10 +01:00
Tim-Philipp Müller
5a12d1efa5 check: remove some cruft from header file
Remove some cruft from the gstcheck header file that's not needed
any longer now that we ship with our own copy of libcheck.
2010-01-10 17:39:55 +00:00
Tim-Philipp Müller
7e6966faf6 check: add some logging before calling gst_task_cleanup_all() 2009-08-10 11:55:35 +01:00
Sebastian Dröge
d465851cb7 check: Call gst_task_cleanup_all() in GST_END_TEST
This fixes many unit tests under valgrind that shows
leaking GstTasks that are not really leaked but just
not unreffed by the task thread before the unit test
stopped.

Fixes bug #591045.
2009-08-08 22:29:03 +02:00
Tim-Philipp Müller
ecbea36d39 check: use private copy of check for libgstcheck
See #577275. Seems to work fine, but doesn't distcheck yet.
2009-08-06 17:27:12 +01:00
Sebastian Dröge
3933296685 gstcheck: Call gst_check_init() before creating the suite
This allows using the GStreamer or GObject API in the suite
creation function.
2009-04-02 10:44:23 +02:00
Tim-Philipp Müller
d430552ec3 gstcheck: fix for check versions > 0.9.6
A new argument allowed_exit_value was added in SVN recently (#574213).
2009-03-19 21:31:08 +00:00
Peter Kjellerstedt
8b4dfd5a07 libs/gst/check/gstcheck.h: Allow check tests to use
Original commit message from CVS:
* libs/gst/check/gstcheck.h: Allow check tests to use
MAIN_START_THREADS()/MAIN_STOP_THREADS() multiple times. Also allows
CK_FORK=no to be used with multiple check test that use threads.
2008-12-10 15:19:45 +00:00
Thijs Vermeir
8442b73552 docs/libs/gstreamer-libs-sections.txt: Add new API to doc
Original commit message from CVS:
* docs/libs/gstreamer-libs-sections.txt:
Add new API to doc
* libs/gst/check/gstcheck.c:
* libs/gst/check/gstcheck.h:
API: gst_check_teardown_pad_by_name
2008-06-21 21:20:13 +00:00
Thijs Vermeir
46b1c45181 libs/gst/check/gstcheck.*: Also setup request pads and allow setup pads by name (#537812)
Original commit message from CVS:
* libs/gst/check/gstcheck.c:
* libs/gst/check/gstcheck.h:
Also setup request pads and allow setup pads by name (#537812)
API: gst_check_setup_src_pad_by_name
API: gst_check_setup_sink_pad_by_name
2008-06-21 19:48:53 +00:00