summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-09-23 15:15:51 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-09-24 14:36:57 +0200
commit3205a9167fca34db8eb177a9050faf1b4115e9fa (patch)
tree81269df2c29e4312148e9b7dcfb0257b8cb235de /tests
parent4b81e9ca7df84d3c8775ebf0332f7444cafe8e77 (diff)
tests/kms_psr_sink_crc: Use options
Env variables are a bit more annoying since much harder to discover. With options you can just see what they do with --help. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/kms_psr_sink_crc.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 767727af..266e7e7b 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -468,16 +468,32 @@ static void run_test(data_t *data)
}
}
-igt_main
+static int opt_handler(int opt, int opt_index)
{
- data_t data = {};
- enum operations op;
- char *env_psr;
+ switch (opt) {
+ case 'n':
+ running_with_psr_disabled = true;
+ break;
+ default:
+ igt_assert(0);
+ }
- env_psr = getenv("IGT_PSR_DISABLED");
+ return 0;
+}
- running_with_psr_disabled = (bool) env_psr;
+int main(int argc, char *argv[])
+{
+ const char *help_str =
+ " --no-psr\tRun test without PSR to check the CRC test logic.";
+ static struct option long_options[] = {
+ {"no-psr", 0, 0, 'n'},
+ { 0, 0, 0, 0 }
+ };
+ data_t data = {};
+ enum operations op;
+ igt_subtest_init_parse_opts(argc, argv, "", long_options,
+ help_str, opt_handler);
igt_skip_on_simulation();
igt_fixture {
@@ -522,4 +538,6 @@ igt_main
drm_intel_bufmgr_destroy(data.bufmgr);
display_fini(&data);
}
+
+ igt_exit();
}