[Intel-gfx] [PATCH 08/10] lib: Introduce drmtest_skip_on_simulation()

Damien Lespiau damien.lespiau at intel.com
Mon Apr 29 20:15:35 CEST 2013


This will allow us to explicitely blacklist tests we don't want to run
on simulation.

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 lib/drmtest.c | 12 ++++++++++++
 lib/drmtest.h |  1 +
 2 files changed, 13 insertions(+)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 6e5b636..cafc8bc 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -38,6 +38,7 @@
 #include <math.h>
 #include <getopt.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 #include "drmtest.h"
 #include "i915_drm.h"
@@ -612,6 +613,17 @@ bool drmtest_run_in_simulation(void)
 	return simulation;
 }
 
+/* Skip the test when running on simulation (and that's relevant only when
+ * we're not in the mode where we list the subtests) */
+void drmtest_skip_on_simulation(void)
+{
+	if (drmtest_only_list_subtests())
+		return;
+
+	if (drmtest_run_in_simulation())
+		exit(77);
+}
+
 /* other helpers */
 void drmtest_exchange_int(void *array, unsigned i, unsigned j)
 {
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 71d68c4..96dddda 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -91,6 +91,7 @@ bool drmtest_only_list_subtests(void);
 
 bool drmtest_run_in_simulation(void);
 #define SLOW_QUICK(slow,quick) (drmtest_run_in_simulation() ? (quick) : (slow))
+void drmtest_skip_on_simulation(void);
 
 /* helpers based upon the libdrm buffer manager */
 void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr);
-- 
1.8.1.4




More information about the Intel-gfx mailing list