check: run skipped tests if explicitly requested via GST_CHECKS
authorTim-Philipp Müller <tim@centricular.net>
Wed, 17 Apr 2013 23:19:23 +0000 (00:19 +0100)
committerTim-Philipp Müller <tim@centricular.net>
Wed, 17 Apr 2013 23:19:23 +0000 (00:19 +0100)
If a test that's disabled with tcase_skip_broken_test() is listed
in the GST_CHECKS environment variable, run it anyway.

libs/gst/check/gstcheck.h

index fe3011e..ecd6797 100644 (file)
@@ -570,9 +570,15 @@ __gst_tcase_add_test (TCase * tc, TFun tf, const char * fname, int signal,
 
 /* add define to skip broken tests */
 #define tcase_skip_broken_test(chain,test_func) \
-  if (0) { tcase_add_test(chain,test_func); } else { \
+G_STMT_START {                                                  \
+  const char *env = g_getenv ("GST_CHECKS");                    \
+                                                                \
+  if (env != NULL && strstr (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)); \
-  }
+  } \
+} G_STMT_END
 
 G_END_DECLS