lib/os: Push simulation test down into intel_require_memory

This has the upside that we'll never forget to add it to thrashing
tests. But we'll also never miss to move it when adding basic
functionality tests to existing binaries. Chris already started this
refining work in e.g.

commit d77eda6614a1955717f224be023dedf74eb7735d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Nov 14 07:45:40 2014 +0000

    igt/gem_linear_blits: Require that we do the full test

by moving igt_skip_on_simulation into subtests.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
This commit is contained in:
Daniel Vetter 2014-11-17 14:46:50 +01:00
parent a535cdedfb
commit 16f99ee419
7 changed files with 6 additions and 16 deletions

View File

@ -210,7 +210,10 @@ intel_get_total_swap_mb(void)
* there is not enough RAM + SWAP!
*
* If there is not enough RAM this function calls igt_skip with an appropriate
* message. It only ever returns if the requirement is fullfilled.
* message. It only ever returns if the requirement is fullfilled. This function
* also causes the test to be skipped automatically on simulation under the
* assumption that any test that needs to check for memory requirements is a
* thrashing test unsuitable for slow simulated systems.
*/
void intel_require_memory(uint32_t count, uint32_t size, unsigned mode)
{
@ -239,6 +242,8 @@ void intel_require_memory(uint32_t count, uint32_t size, unsigned mode)
(long long)required, (long long)total,
mode & (CHECK_RAM | CHECK_SWAP) ? "RAM" : "",
mode & CHECK_SWAP ? " + swap": "");
igt_skip_on_simulation();
}
void

View File

@ -191,8 +191,6 @@ igt_main
{
int size, count;
igt_skip_on_simulation();
igt_fixture {
fd = drm_open_any();
}

View File

@ -182,8 +182,6 @@ igt_main
size = count = 0;
fd = -1;
igt_skip_on_simulation();
igt_fixture {
fd = drm_open_any();

View File

@ -264,8 +264,6 @@ int main(int argc, char **argv)
igt_subtest("normal") {
int count;
igt_skip_on_simulation();
count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
igt_require(count > 1);
intel_require_memory(count, sizeof(linear), CHECK_RAM);
@ -275,8 +273,6 @@ int main(int argc, char **argv)
igt_subtest("interruptible") {
int count;
igt_skip_on_simulation();
count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
igt_require(count > 1);
intel_require_memory(count, sizeof(linear), CHECK_RAM);

View File

@ -214,8 +214,6 @@ int main(int argc, char **argv)
igt_subtest("normal") {
int count;
igt_skip_on_simulation();
count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
count += (count & 1) == 0;
intel_require_memory(count, 1024*1024, CHECK_RAM);
@ -226,8 +224,6 @@ int main(int argc, char **argv)
igt_subtest("interruptible") {
int count;
igt_skip_on_simulation();
count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
count += (count & 1) == 0;
intel_require_memory(count, 1024*1024, CHECK_RAM);

View File

@ -150,7 +150,6 @@ igt_simple_main
current_tiling_mode = I915_TILING_X;
igt_skip_on_simulation();
intel_purge_vm_caches();
fd = drm_open_any();

View File

@ -1240,8 +1240,6 @@ int main(int argc, char **argv)
{
int size = sizeof(linear);
igt_skip_on_simulation();
igt_subtest_init(argc, argv);
igt_fixture {