[Intel-gfx] [PATCH] tests: Sprinkle missing igt_exit() where needed.

Gore, Tim tim.gore at intel.com
Thu Oct 2 14:07:09 CEST 2014



> -----Original Message-----
> From: root [mailto:daniel.vetter at ffwll.ch]
> Sent: Thursday, October 02, 2014 10:36 AM
> To: Intel Graphics Development
> Cc: Daniel Vetter; Gore, Tim; Vetter, Daniel
> Subject: [PATCH] tests: Sprinkle missing igt_exit() where needed.
> 
> From: Daniel Vetter <daniel.vetter at ffwll.ch>
> 
> Yay for breaking piles of tests.
> 
> This regression has been introduced with
> 

Oops yes, this was my mistake. Forgot about the tests that use the igt init
function but then just use return.  Patch looks sensible, especially as this
brings the single tests more into line with the multi-tests. I am very much
in favour of this.

  Tim

> commit 5782eca1e19e85a04ad402fa4094aa1b5f9c53ce
> Author: Tim Gore <tim.gore at intel.com>
> Date:   Wed Oct 1 13:25:20 2014 +0100
> 
>     lib/igt_core.c: disable lowmemorykiller during tests
> 
> Cc: Tim Gore <tim.gore at intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  tests/gem_ctx_basic.c            | 2 +-
>  tests/gem_exec_blt.c             | 2 +-
>  tests/gem_gtt_speed.c            | 2 +-
>  tests/gem_hang.c                 | 2 +-
>  tests/gem_ppgtt.c                | 2 --
>  tests/gem_render_copy.c          | 2 +-
>  tests/gem_render_copy_redux.c    | 2 --
>  tests/gem_render_linear_blits.c  | 2 +-
>  tests/gem_render_tiled_blits.c   | 2 +-
>  tests/gem_seqno_wrap.c           | 7 ++-----
>  tests/gem_stress.c               | 2 +-
>  tests/gem_userptr_blits.c        | 2 --
>  tests/gen3_mixed_blits.c         | 2 +-
>  tests/gen3_render_linear_blits.c | 2 +-  tests/gen3_render_mixed_blits.c  |
> 2 +-  tests/gen3_render_tiledx_blits.c | 2 +-
> tests/gen3_render_tiledy_blits.c | 2 +-
>  tests/testdisplay.c              | 4 +++-
>  18 files changed, 18 insertions(+), 25 deletions(-)
> 
> diff --git a/tests/gem_ctx_basic.c b/tests/gem_ctx_basic.c index
> a0bec602a911..b8b01c03e122 100644
> --- a/tests/gem_ctx_basic.c
> +++ b/tests/gem_ctx_basic.c
> @@ -166,5 +166,5 @@ int main(int argc, char *argv[])
>  	free(threads);
>  	close(fd);
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gem_exec_blt.c b/tests/gem_exec_blt.c index
> db997b335197..301c9397c590 100644
> --- a/tests/gem_exec_blt.c
> +++ b/tests/gem_exec_blt.c
> @@ -270,5 +270,5 @@ int main(int argc, char **argv)
>  	} else
>  		run(OBJECT_SIZE);
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gem_gtt_speed.c b/tests/gem_gtt_speed.c index
> 5125078d36e8..c8581035653d 100644
> --- a/tests/gem_gtt_speed.c
> +++ b/tests/gem_gtt_speed.c
> @@ -329,5 +329,5 @@ int main(int argc, char **argv)
>  	gem_close(fd, handle);
>  	close(fd);
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gem_hang.c b/tests/gem_hang.c index
> 7a7c8acbd84a..8767615c83ea 100644
> --- a/tests/gem_hang.c
> +++ b/tests/gem_hang.c
> @@ -93,5 +93,5 @@ int main(int argc, char **argv)
> 
>  	close(fd);
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gem_ppgtt.c b/tests/gem_ppgtt.c index
> 8c560f269601..0ee4f5b2a31e 100644
> --- a/tests/gem_ppgtt.c
> +++ b/tests/gem_ppgtt.c
> @@ -230,6 +230,4 @@ int main(int argc, char **argv)
>  	}
> 
>  	igt_exit();
> -
> -	return 0;
>  }
> diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c index
> 6ff0c776e5e4..094816c92143 100644
> --- a/tests/gem_render_copy.c
> +++ b/tests/gem_render_copy.c
> @@ -186,5 +186,5 @@ int main(int argc, char **argv)
>  		scratch_buf_check(&data, &dst, WIDTH - 10, HEIGHT - 10,
> SRC_COLOR);
>  	}
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gem_render_copy_redux.c
> b/tests/gem_render_copy_redux.c index cb48aa73e6c3..6fc82df9a858
> 100644
> --- a/tests/gem_render_copy_redux.c
> +++ b/tests/gem_render_copy_redux.c
> @@ -241,6 +241,4 @@ int main(int argc, char **argv)
>  	}
> 
>  	igt_exit();
> -
> -	return 0;
>  }
> diff --git a/tests/gem_render_linear_blits.c
> b/tests/gem_render_linear_blits.c index 28fd8c8c482a..60ba83162d40
> 100644
> --- a/tests/gem_render_linear_blits.c
> +++ b/tests/gem_render_linear_blits.c
> @@ -200,5 +200,5 @@ int main(int argc, char **argv)
>  	for (i = 0; i < count; i++)
>  		check_bo(fd, bo[i]->handle, start_val[i]);
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c
> index ea1d59da8f07..dc22529c4d7e 100644
> --- a/tests/gem_render_tiled_blits.c
> +++ b/tests/gem_render_tiled_blits.c
> @@ -211,5 +211,5 @@ int main(int argc, char **argv)
>  	for (i = 0; i < count; i++)
>  		check_bo(batch, &buf[i], start_val[i]);
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c index
> e8528ec68575..6772d1e1436f 100644
> --- a/tests/gem_seqno_wrap.c
> +++ b/tests/gem_seqno_wrap.c
> @@ -527,10 +527,7 @@ int main(int argc, char **argv)
>  			  options.dontwrap ? "tests" : "wraps", wcount);
>  	}
> 
> -	if (options.rounds == wcount) {
> -		igt_debug("done %d wraps successfully\n", wcount);
> -		return 0;
> -	}
> +	igt_assert(options.rounds == wcount);
> 
> -	return r;
> +	igt_exit();
>  }
> diff --git a/tests/gem_stress.c b/tests/gem_stress.c index
> 8d62b0357565..ab2cd0eb4656 100644
> --- a/tests/gem_stress.c
> +++ b/tests/gem_stress.c
> @@ -914,5 +914,5 @@ int main(int argc, char **argv)
> 
>  	igt_stop_signal_helper();
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c index
> 638b74c29c24..a729f3191dae 100644
> --- a/tests/gem_userptr_blits.c
> +++ b/tests/gem_userptr_blits.c
> @@ -1443,6 +1443,4 @@ int main(int argc, char **argv)
>  		test_access_control(fd);
> 
>  	igt_exit();
> -
> -	return 0;
>  }
> diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c index
> 33eea746cb4b..2d41cb4e2a88 100644
> --- a/tests/gen3_mixed_blits.c
> +++ b/tests/gen3_mixed_blits.c
> @@ -533,5 +533,5 @@ int main(int argc, char **argv)
>  		check_bo(fd, handle[i], start_val[i]);
>  	igt_info("done\n");
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gen3_render_linear_blits.c
> b/tests/gen3_render_linear_blits.c
> index 7d4a228f4269..9bf9c306e2c1 100644
> --- a/tests/gen3_render_linear_blits.c
> +++ b/tests/gen3_render_linear_blits.c
> @@ -393,5 +393,5 @@ int main(int argc, char **argv)
>  	for (i = 0; i < count; i++)
>  		check_bo(fd, handle[i], start_val[i]);
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gen3_render_mixed_blits.c
> b/tests/gen3_render_mixed_blits.c index 1fe323c49ad7..bdfd66f6883e
> 100644
> --- a/tests/gen3_render_mixed_blits.c
> +++ b/tests/gen3_render_mixed_blits.c
> @@ -421,5 +421,5 @@ int main(int argc, char **argv)
>  		check_bo(fd, handle[i], start_val[i]);
>  	igt_info("done\n");
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gen3_render_tiledx_blits.c
> b/tests/gen3_render_tiledx_blits.c
> index d8e2e87f852d..92a77f21ed5f 100644
> --- a/tests/gen3_render_tiledx_blits.c
> +++ b/tests/gen3_render_tiledx_blits.c
> @@ -400,5 +400,5 @@ int main(int argc, char **argv)
>  	for (i = 0; i < count; i++)
>  		check_bo(fd, handle[i], start_val[i]);
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/gen3_render_tiledy_blits.c
> b/tests/gen3_render_tiledy_blits.c
> index 1a819e564687..8927c0b4ef89 100644
> --- a/tests/gen3_render_tiledy_blits.c
> +++ b/tests/gen3_render_tiledy_blits.c
> @@ -407,5 +407,5 @@ int main(int argc, char **argv)
>  		check_bo(fd, handle[i], start_val[i]);
>  	igt_info("done\n");
> 
> -	return 0;
> +	igt_exit();
>  }
> diff --git a/tests/testdisplay.c b/tests/testdisplay.c index
> a3cba44eb938..04e41db8e01a 100644
> --- a/tests/testdisplay.c
> +++ b/tests/testdisplay.c
> @@ -786,5 +786,7 @@ out_mainloop:
>  out_close:
>  	close(drm_fd);
> 
> -	return ret;
> +	igt_assert(ret);
> +
> +	igt_exit();
>  }
> --
> 1.9.3




More information about the Intel-gfx mailing list