[Intel-gfx] [PATCH 21/23] lib: Introduce igt_run_quick()
Damien Lespiau
damien.lespiau at intel.com
Fri Nov 15 17:33:38 CET 2013
Turns out that we'd like to be able a "quick" version of the tests on
real hardware as well. So "in simulation" and "quick" are two different
concepts.
Note that "in simulation" implies "quick", so igt_run_quick() tests if
we are running on simulation before looking at the IGT_QUICK env
variable.
Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
lib/drmtest.c | 15 +++++++++++++++
lib/drmtest.h | 3 ++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 15ed847..5760c87 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -1278,6 +1278,21 @@ bool igt_run_in_simulation(void)
return simulation;
}
+bool igt_run_quick(void)
+{
+ static int quick = -1;
+
+ if (quick == -1) {
+ if (igt_run_in_simulation())
+ quick = true;
+ else
+ quick = env_set("IGT_QUICK", false);
+ }
+
+ return quick;
+}
+
+
/**
* igt_skip_on_simulation - skip tests when INTEL_SIMULATION env war is set
*
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 5295a7b..c93fe6b 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -300,8 +300,9 @@ static inline void gem_require_ring(int fd, int ring_id)
}
}
-/* helpers to automatically reduce test runtime in simulation */
+/* helpers to automatically reduce test runtime */
bool igt_run_in_simulation(void);
+bool igt_run_quick(void);
#define SLOW_QUICK(slow,quick) (igt_run_in_simulation() ? (quick) : (slow))
/**
* igt_skip_on_simulation - skip tests when INTEL_SIMULATION env war is set
--
1.8.3.1
More information about the Intel-gfx
mailing list