tests/kms_setmode: don't save/restore vt graphics for dry-run
authorImre Deak <imre.deak@intel.com>
Mon, 26 Aug 2013 14:15:46 +0000 (17:15 +0300)
committerImre Deak <imre.deak@intel.com>
Mon, 26 Aug 2013 14:20:29 +0000 (17:20 +0300)
Signed-off-by: Imre Deak <imre.deak@intel.com>
lib/drmtest.c
tests/kms_setmode.c

index ad91c65..37d7da3 100644 (file)
@@ -744,12 +744,12 @@ int igt_subtest_init_parse_opts(int argc, char **argv,
                        break;
                case 'h':
                        print_usage(command_str, help_str, false);
-                       ret = -2;
+                       ret = -1;
                        goto out;
                case '?':
                        if (opterr) {
                                print_usage(command_str, help_str, true);
-                               ret = -1;
+                               ret = -2;
                                goto out;
                        }
                        /*
@@ -779,7 +779,7 @@ void igt_subtest_init(int argc, char **argv)
        ret = igt_subtest_init_parse_opts(argc, argv, NULL, NULL, NULL, NULL);
        if (ret < 0)
                /* exit with no error for -h/--help */
-               exit(ret == -2 ? 0 : ret);
+               exit(ret == -1 ? 0 : ret);
 
        /* reset opt parsing */
        optind = 1;
index 47fab25..7b22225 100644 (file)
@@ -701,7 +701,8 @@ int main(int argc, char **argv)
 
        igt_fixture {
                drm_fd = drm_open_any();
-               do_or_die(igt_set_vt_graphics_mode());
+               if (!dry_run)
+                       do_or_die(igt_set_vt_graphics_mode());
 
                drm_resources = drmModeGetResources(drm_fd);
                assert(drm_resources);