diff mbox

[v2,i-g-t] intel-gpu-tools: add igt_core init func calls to some tests

Message ID 1407271884-6414-1-git-send-email-sean.v.kelley@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kelley, Sean V Aug. 5, 2014, 8:51 p.m. UTC
From: Tim Gore <tim.gore@intel.com>

igt-core.h/c provides some macros and initialisation
functions to support the tests but some of the single
tests do not use these. Modifying these tests to use
the igt_simple_main macro and igt_simple_init function
is the first step towards a consistent command line
across all tests.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 tests/gem_bad_address.c      | 4 +---
 tests/gem_bad_batch.c        | 4 +---
 tests/gem_bad_blit.c         | 4 +---
 tests/gem_hang.c             | 2 ++
 tests/gem_non_secure_batch.c | 4 +---
 tests/gem_stress.c           | 2 ++
 6 files changed, 8 insertions(+), 12 deletions(-)

Comments

Kelley, Sean V Aug. 5, 2014, 8:54 p.m. UTC | #1
Ignore PBKAC.

On Tue, Aug 5, 2014 at 1:51 PM, Sean V Kelley <sean.v.kelley@intel.com> wrote:
> From: Tim Gore <tim.gore@intel.com>
>
> igt-core.h/c provides some macros and initialisation
> functions to support the tests but some of the single
> tests do not use these. Modifying these tests to use
> the igt_simple_main macro and igt_simple_init function
> is the first step towards a consistent command line
> across all tests.
>
> Signed-off-by: Tim Gore <tim.gore@intel.com>
> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
> ---
>  tests/gem_bad_address.c      | 4 +---
>  tests/gem_bad_batch.c        | 4 +---
>  tests/gem_bad_blit.c         | 4 +---
>  tests/gem_hang.c             | 2 ++
>  tests/gem_non_secure_batch.c | 4 +---
>  tests/gem_stress.c           | 2 ++
>  6 files changed, 8 insertions(+), 12 deletions(-)
>
> diff --git a/tests/gem_bad_address.c b/tests/gem_bad_address.c
> index f8fda90..e7a9587 100644
> --- a/tests/gem_bad_address.c
> +++ b/tests/gem_bad_address.c
> @@ -60,7 +60,7 @@ bad_store(void)
>         intel_batchbuffer_flush(batch);
>  }
>
> -int main(int argc, char **argv)
> +igt_simple_main
>  {
>         int fd;
>
> @@ -76,6 +76,4 @@ int main(int argc, char **argv)
>         drm_intel_bufmgr_destroy(bufmgr);
>
>         close(fd);
> -
> -       return 0;
>  }
> diff --git a/tests/gem_bad_batch.c b/tests/gem_bad_batch.c
> index 33b3241..7f92a93 100644
> --- a/tests/gem_bad_batch.c
> +++ b/tests/gem_bad_batch.c
> @@ -56,7 +56,7 @@ bad_batch(void)
>         intel_batchbuffer_flush(batch);
>  }
>
> -int main(int argc, char **argv)
> +igt_simple_main
>  {
>         int fd;
>
> @@ -72,6 +72,4 @@ int main(int argc, char **argv)
>         drm_intel_bufmgr_destroy(bufmgr);
>
>         close(fd);
> -
> -       return 0;
>  }
> diff --git a/tests/gem_bad_blit.c b/tests/gem_bad_blit.c
> index 9c03117..71a9f78 100644
> --- a/tests/gem_bad_blit.c
> +++ b/tests/gem_bad_blit.c
> @@ -95,7 +95,7 @@ bad_blit(drm_intel_bo *src_bo, uint32_t devid)
>         intel_batchbuffer_flush(batch);
>  }
>
> -int main(int argc, char **argv)
> +igt_simple_main
>  {
>         drm_intel_bo *src;
>         int fd;
> @@ -114,6 +114,4 @@ int main(int argc, char **argv)
>         drm_intel_bufmgr_destroy(bufmgr);
>
>         close(fd);
> -
> -       return 0;
>  }
> diff --git a/tests/gem_hang.c b/tests/gem_hang.c
> index 8ebf606..6248244 100644
> --- a/tests/gem_hang.c
> +++ b/tests/gem_hang.c
> @@ -72,6 +72,8 @@ int main(int argc, char **argv)
>  {
>         int fd;
>
> +       igt_simple_init();
> +
>         igt_assert_f(argc == 2,
>                      "usage: %s <disabled pipe number>\n",
>                      argv[0]);
> diff --git a/tests/gem_non_secure_batch.c b/tests/gem_non_secure_batch.c
> index 9acfda4..01101e9 100644
> --- a/tests/gem_non_secure_batch.c
> +++ b/tests/gem_non_secure_batch.c
> @@ -77,7 +77,7 @@ mi_lri_loop(void)
>         }
>  }
>
> -int main(int argc, char **argv)
> +igt_simple_main
>  {
>         int fd;
>         int devid;
> @@ -108,6 +108,4 @@ int main(int argc, char **argv)
>         drm_intel_bufmgr_destroy(bufmgr);
>
>         close(fd);
> -
> -       return 0;
>  }
> diff --git a/tests/gem_stress.c b/tests/gem_stress.c
> index d46c643..2ccb6fc 100644
> --- a/tests/gem_stress.c
> +++ b/tests/gem_stress.c
> @@ -865,6 +865,8 @@ int main(int argc, char **argv)
>         int i, j;
>         unsigned *current_permutation, *tmp_permutation;
>
> +       igt_simple_init();
> +
>         drm_fd = drm_open_any();
>         devid = intel_get_drm_devid(drm_fd);
>
> --
> 2.0.1
>
diff mbox

Patch

diff --git a/tests/gem_bad_address.c b/tests/gem_bad_address.c
index f8fda90..e7a9587 100644
--- a/tests/gem_bad_address.c
+++ b/tests/gem_bad_address.c
@@ -60,7 +60,7 @@  bad_store(void)
 	intel_batchbuffer_flush(batch);
 }
 
-int main(int argc, char **argv)
+igt_simple_main
 {
 	int fd;
 
@@ -76,6 +76,4 @@  int main(int argc, char **argv)
 	drm_intel_bufmgr_destroy(bufmgr);
 
 	close(fd);
-
-	return 0;
 }
diff --git a/tests/gem_bad_batch.c b/tests/gem_bad_batch.c
index 33b3241..7f92a93 100644
--- a/tests/gem_bad_batch.c
+++ b/tests/gem_bad_batch.c
@@ -56,7 +56,7 @@  bad_batch(void)
 	intel_batchbuffer_flush(batch);
 }
 
-int main(int argc, char **argv)
+igt_simple_main
 {
 	int fd;
 
@@ -72,6 +72,4 @@  int main(int argc, char **argv)
 	drm_intel_bufmgr_destroy(bufmgr);
 
 	close(fd);
-
-	return 0;
 }
diff --git a/tests/gem_bad_blit.c b/tests/gem_bad_blit.c
index 9c03117..71a9f78 100644
--- a/tests/gem_bad_blit.c
+++ b/tests/gem_bad_blit.c
@@ -95,7 +95,7 @@  bad_blit(drm_intel_bo *src_bo, uint32_t devid)
 	intel_batchbuffer_flush(batch);
 }
 
-int main(int argc, char **argv)
+igt_simple_main
 {
 	drm_intel_bo *src;
 	int fd;
@@ -114,6 +114,4 @@  int main(int argc, char **argv)
 	drm_intel_bufmgr_destroy(bufmgr);
 
 	close(fd);
-
-	return 0;
 }
diff --git a/tests/gem_hang.c b/tests/gem_hang.c
index 8ebf606..6248244 100644
--- a/tests/gem_hang.c
+++ b/tests/gem_hang.c
@@ -72,6 +72,8 @@  int main(int argc, char **argv)
 {
 	int fd;
 
+	igt_simple_init();
+
 	igt_assert_f(argc == 2,
 		     "usage: %s <disabled pipe number>\n",
 		     argv[0]);
diff --git a/tests/gem_non_secure_batch.c b/tests/gem_non_secure_batch.c
index 9acfda4..01101e9 100644
--- a/tests/gem_non_secure_batch.c
+++ b/tests/gem_non_secure_batch.c
@@ -77,7 +77,7 @@  mi_lri_loop(void)
 	}
 }
 
-int main(int argc, char **argv)
+igt_simple_main
 {
 	int fd;
 	int devid;
@@ -108,6 +108,4 @@  int main(int argc, char **argv)
 	drm_intel_bufmgr_destroy(bufmgr);
 
 	close(fd);
-
-	return 0;
 }
diff --git a/tests/gem_stress.c b/tests/gem_stress.c
index d46c643..2ccb6fc 100644
--- a/tests/gem_stress.c
+++ b/tests/gem_stress.c
@@ -865,6 +865,8 @@  int main(int argc, char **argv)
 	int i, j;
 	unsigned *current_permutation, *tmp_permutation;
 
+	igt_simple_init();
+
 	drm_fd = drm_open_any();
 	devid = intel_get_drm_devid(drm_fd);