[igt-dev] [PATH i-g-t 1/2] intel: Be consistent with test results on simulation

Tvrtko Ursulin tursulin at ursulin.net
Wed Sep 12 09:33:05 UTC 2018


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Tests which call intel_require_memory currently always skip on simulation,
unless they fail first due insufficient memory. This can create different
outcomes depending on the simulation environment so move the simulation
skip to the start of the function for 100% consistency in results.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg at intel.com>
---
 lib/intel_os.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/intel_os.c b/lib/intel_os.c
index 29a27272e782..e1e31e23069b 100644
--- a/lib/intel_os.c
+++ b/lib/intel_os.c
@@ -375,6 +375,8 @@ void intel_require_memory(uint64_t count, uint64_t size, unsigned mode)
 	uint64_t required, total;
 	bool sufficient_memory;
 
+	igt_skip_on_simulation();
+
 	sufficient_memory = __intel_check_memory(count, size, mode,
 						 &required, &total);
 	if (!sufficient_memory) {
@@ -406,8 +408,6 @@ void intel_require_memory(uint64_t count, uint64_t size, unsigned mode)
 		      mode & (CHECK_RAM | CHECK_SWAP) ? "RAM" : "",
 		      mode & CHECK_SWAP ? " + swap": "",
 		      (long long)vfs_file_max());
-
-	igt_skip_on_simulation();
 }
 
 void intel_purge_vm_caches(int drm_fd)
-- 
2.17.1



More information about the igt-dev mailing list