check: also use the glob on GST_CHECKS when forcing to run broken tests
authorStefan Sauer <ensonic@users.sf.net>
Wed, 19 Feb 2014 09:57:33 +0000 (10:57 +0100)
committerStefan Sauer <ensonic@users.sf.net>
Wed, 19 Feb 2014 10:04:17 +0000 (11:04 +0100)
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.

libs/gst/check/gstcheck.c
libs/gst/check/gstcheck.h

index 92ad5a8..bac4782 100644 (file)
  *
  * 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"
index 7b4b9d4..c1d7d83 100644 (file)
@@ -558,7 +558,8 @@ int main (int argc, char **argv)                                \
 }
 
 /* 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);
 
@@ -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
 
-/* 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)); \