*
* These macros and functions are for internal use of the unit tests found
* 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
#include "config.h"
}
/* 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);
#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) \
G_STMT_START { \
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); \
} else { \
g_printerr ("FIXME: skipping test %s because it's broken\n", G_STRINGIFY (test_func)); \