mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-07 23:12:42 +00:00
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.
This commit is contained in:
parent
252aa44887
commit
6fc23cd016
2 changed files with 9 additions and 3 deletions
|
@ -26,6 +26,10 @@
|
||||||
*
|
*
|
||||||
* These macros and functions are for internal use of the unit tests found
|
* These macros and functions are for internal use of the unit tests found
|
||||||
* inside the 'check' directories of various GStreamer packages.
|
* inside the 'check' directories of various GStreamer packages.
|
||||||
|
*
|
||||||
|
* One notable feature is that one can use the environment variables GST_CHECK
|
||||||
|
* and GST_CHECK_IGNORE to select which tests to run or skip. Both variables
|
||||||
|
* can contain a comman separated list of test name globs (e.g. test_*).
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
|
@ -558,7 +558,8 @@ int main (int argc, char **argv) \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hack to allow run-time selection of unit tests to run via the
|
/* Hack to allow run-time selection of unit tests to run via the
|
||||||
* GST_CHECKS environment variable (test function names, comma-separated) */
|
* GST_CHECKS environment variable (test function names globs, comma
|
||||||
|
* separated), or GST_CHECKS_IGNORE with the same semantics */
|
||||||
|
|
||||||
gboolean _gst_check_run_test_func (const gchar * func_name);
|
gboolean _gst_check_run_test_func (const gchar * func_name);
|
||||||
|
|
||||||
|
@ -573,12 +574,13 @@ __gst_tcase_add_test (TCase * tc, TFun tf, const char * fname, int signal,
|
||||||
|
|
||||||
#define _tcase_add_test __gst_tcase_add_test
|
#define _tcase_add_test __gst_tcase_add_test
|
||||||
|
|
||||||
/* add define to skip broken tests */
|
/* A special variant to add broken tests. These are normally skipped, but can be
|
||||||
|
* forced to run via GST_CHECKS */
|
||||||
#define tcase_skip_broken_test(chain,test_func) \
|
#define tcase_skip_broken_test(chain,test_func) \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
const char *env = g_getenv ("GST_CHECKS"); \
|
const char *env = g_getenv ("GST_CHECKS"); \
|
||||||
\
|
\
|
||||||
if (env != NULL && strstr (env, G_STRINGIFY (test_func))) { \
|
if (env != NULL && g_pattern_match_simple (env, G_STRINGIFY (test_func))) { \
|
||||||
tcase_add_test(chain,test_func); \
|
tcase_add_test(chain,test_func); \
|
||||||
} else { \
|
} else { \
|
||||||
g_printerr ("FIXME: skipping test %s because it's broken\n", G_STRINGIFY (test_func)); \
|
g_printerr ("FIXME: skipping test %s because it's broken\n", G_STRINGIFY (test_func)); \
|
||||||
|
|
Loading…
Reference in a new issue