From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t 27/36] kms_frontbuffer_tracking: Nuke custom main function
Date: Thu, 23 May 2019 15:27:18 +0300 [thread overview]
Message-ID: <20190523122727.6932-27-petri.latvala@intel.com> (raw)
In-Reply-To: <20190523122727.6932-1-petri.latvala@intel.com>
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
tests/kms_frontbuffer_tracking.c | 62 ++++++++++++++++----------------
1 file changed, 32 insertions(+), 30 deletions(-)
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index ee13b138..1037faf8 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -3070,19 +3070,23 @@ static int opt_handler(int option, int option_index, void *data)
case 'x':
errno = 0;
opt.shared_fb_x_offset = strtol(optarg, NULL, 0);
- igt_assert(errno == 0);
+ if (errno != 0)
+ return IGT_OPT_HANDLER_ERROR;
break;
case 'y':
errno = 0;
opt.shared_fb_y_offset = strtol(optarg, NULL, 0);
- igt_assert(errno == 0);
+ if (errno != 0)
+ return IGT_OPT_HANDLER_ERROR;
break;
case '1':
- igt_assert_eq(opt.only_pipes, PIPE_COUNT);
+ if (opt.only_pipes != PIPE_COUNT)
+ return IGT_OPT_HANDLER_ERROR;
opt.only_pipes = PIPE_SINGLE;
break;
case '2':
- igt_assert_eq(opt.only_pipes, PIPE_COUNT);
+ if (opt.only_pipes != PIPE_COUNT)
+ return IGT_OPT_HANDLER_ERROR;
opt.only_pipes = PIPE_DUAL;
break;
case 'l':
@@ -3090,14 +3094,16 @@ static int opt_handler(int option, int option_index, void *data)
opt.tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
else if (!strcmp(optarg, "y"))
opt.tiling = LOCAL_I915_FORMAT_MOD_Y_TILED;
- else
- igt_assert_f(false, "Bad tiling value: %s\n", optarg);
+ else {
+ igt_warn("Bad tiling value: %s\n", optarg);
+ return IGT_OPT_HANDLER_ERROR;
+ }
break;
default:
- igt_assert(false);
+ return IGT_OPT_HANDLER_ERROR;
}
- return 0;
+ return IGT_OPT_HANDLER_SUCCESS;
}
const char *help_str =
@@ -3245,28 +3251,26 @@ static const char *flip_str(enum flip_type flip)
#define TEST_MODE_ITER_END } } } } } }
-int main(int argc, char *argv[])
+struct option long_options[] = {
+ { "no-status-check", 0, 0, 's'},
+ { "no-crc-check", 0, 0, 'c'},
+ { "no-fbc-compression-check", 0, 0, 'o'},
+ { "no-fbc-action-check", 0, 0, 'a'},
+ { "no-edp", 0, 0, 'e'},
+ { "use-small-modes", 0, 0, 'm'},
+ { "show-hidden", 0, 0, 'i'},
+ { "step", 0, 0, 't'},
+ { "shared-fb-x", 1, 0, 'x'},
+ { "shared-fb-y", 1, 0, 'y'},
+ { "1p-only", 0, 0, '1'},
+ { "2p-only", 0, 0, '2'},
+ { "tiling", 1, 0, 'l'},
+ { 0, 0, 0, 0 }
+};
+
+igt_main_args("", long_options, help_str, opt_handler, NULL)
{
struct test_mode t;
- struct option long_options[] = {
- { "no-status-check", 0, 0, 's'},
- { "no-crc-check", 0, 0, 'c'},
- { "no-fbc-compression-check", 0, 0, 'o'},
- { "no-fbc-action-check", 0, 0, 'a'},
- { "no-edp", 0, 0, 'e'},
- { "use-small-modes", 0, 0, 'm'},
- { "show-hidden", 0, 0, 'i'},
- { "step", 0, 0, 't'},
- { "shared-fb-x", 1, 0, 'x'},
- { "shared-fb-y", 1, 0, 'y'},
- { "1p-only", 0, 0, '1'},
- { "2p-only", 0, 0, '2'},
- { "tiling", 1, 0, 'l'},
- { 0, 0, 0, 0 }
- };
-
- igt_subtest_init_parse_opts(&argc, argv, "", long_options, help_str,
- opt_handler, NULL);
igt_fixture
setup_environment();
@@ -3473,6 +3477,4 @@ int main(int argc, char *argv[])
igt_fixture
teardown_environment();
-
- igt_exit();
}
--
2.19.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-05-23 12:27 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 02/36] lib: Document igt_opt_handler_t semantics Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 03/36] i915/gem_exec_blt: Nuke custom main function Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 04/36] i915/gem_gtt_speed: " Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 05/36] i915/gem_hang: " Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 06/36] i915/gem_linear_blits: " Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 07/36] i915/gem_ppgtt: " Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 08/36] i915/gem_pread: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 09/36] i915/gem_pwrite: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 10/36] i915/gem_pwrite_pread: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 11/36] i915/gem_render_copy: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 12/36] i915/gem_render_copy_redux: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 13/36] i915/gem_request_retire: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 14/36] i915/gem_stress: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 15/36] i915/gem_tiled_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 16/36] i915/gem_userptr_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 17/36] i915/gen3_mixed_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 18/36] i915/gen3_render_linear_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 19/36] i915/gen3_render_mixed_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 20/36] i915/gen3_render_tiledx_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 21/36] i915/gen3_render_tiledy_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 22/36] i915/i915_pm_rpm: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 23/36] kms_concurrent: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 24/36] kms_cursor_edge_walk: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 25/36] kms_flip: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 26/36] kms_force_connector_basic: " Petri Latvala
2019-05-23 12:27 ` Petri Latvala [this message]
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 28/36] kms_mmap_write_crc: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 29/36] kms_plane_multiple: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 30/36] kms_psr2_su: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 31/36] kms_psr: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 32/36] kms_setmode: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 33/36] kms_tv_load_detect: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 34/36] prime_mmap_coherency: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 35/36] testdisplay: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 36/36] tests: Remove redundant igt_exit() calls Petri Latvala
2019-05-23 14:29 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/36] lib: Introduce main function macros with custom args Patchwork
2019-05-24 13:50 ` [igt-dev] [PATCH i-g-t 01/36] " Arkadiusz Hiler
2019-05-24 18:14 ` Daniel Vetter
2019-05-24 18:26 ` Hiatt, Don
2019-05-24 19:38 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,01/36] " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190523122727.6932-27-petri.latvala@intel.com \
--to=petri.latvala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox