gallium: run gallium tests if GALLIUM_TESTS=1 is set
[mesa.git] / src / gallium / auxiliary / target-helpers / inline_debug_helper.h
index c6630c40f5cfd50f47c693a779cbec4851598a28..faae1800e7211babfcc12721903190293e42354f 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "pipe/p_compiler.h"
 #include "util/u_debug.h"
+#include "util/u_tests.h"
 
 
 /* Helper function to wrap a screen with
 #include "noop/noop_public.h"
 #endif
 
+/*
+ * TODO: Audit the following *screen_create() - all of
+ * them should return the original screen on failuire.
+ */
 static INLINE struct pipe_screen *
 debug_screen_wrap(struct pipe_screen *screen)
 {
-
 #if defined(GALLIUM_RBUG)
    screen = rbug_screen_create(screen);
 #endif
@@ -46,6 +50,9 @@ debug_screen_wrap(struct pipe_screen *screen)
    screen = noop_screen_create(screen);
 #endif
 
+   if (debug_get_bool_option("GALLIUM_TESTS", FALSE))
+      util_run_tests(screen);
+
    return screen;
 }