summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2014-02-26 11:12:28 -0300
committerPaulo Zanoni <paulo.r.zanoni@intel.com>2014-02-26 19:14:56 -0300
commit6a6b8a213813de80a86d281ee9111aaca8ed5b36 (patch)
treef70dae01024470b2c33f60b84ba89f1f159fdbd2 /tests
parent8c475e0ba69c585bc11062edd1f7fc4bbded811c (diff)
tests/pm_pc8: add "stay" mode
I used to have a binary that would just disable all the screens - so we can enter PC8/runtime PM - and then sleep forever. I used this binary many times while debugging PC8 and runtime PM, and I also sent the binary to many people so they would be able to test these things without X running. Since pm_pc8 already implements everything that the separate binary needs, and it even has some additional code to try to configure the environment to actually reach PC8, it's easier to just ask people to run "sudo ./pm_pc8 --stay" instead of sending them a file, asking them to compile it, setup the environment, and then run it. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/pm_pc8.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/pm_pc8.c b/tests/pm_pc8.c
index 54d04b1a..b8133e87 100644
--- a/tests/pm_pc8.c
+++ b/tests/pm_pc8.c
@@ -1435,9 +1435,19 @@ static void pci_d3_state_subtest(void)
igt_assert(!device_in_pci_d3());
}
+static void stay_subtest(void)
+{
+ disable_all_screens(&ms_data);
+ igt_assert(wait_for_suspended());
+
+ while (1)
+ sleep(600);
+}
+
int main(int argc, char *argv[])
{
int rounds = 50;
+ bool stay = false;
igt_subtest_init(argc, argv);
@@ -1447,12 +1457,22 @@ int main(int argc, char *argv[])
if (argc > 1 && strcmp(argv[1], "--quick") == 0)
rounds = 10;
+ /* The --stay option enables a mode where we disable all the screens,
+ * then stay like that, runtime suspended. This mode is useful for
+ * running manual tests while debugging. */
+ if (argc > 1 && strcmp(argv[1], "--stay") == 0)
+ stay = true;
+
/* Skip instead of failing in case the machine is not prepared to reach
* PC8+. We don't want bug reports from cases where the machine is just
* not properly configured. */
igt_fixture
setup_environment();
+ if (stay)
+ igt_subtest("stay")
+ stay_subtest();
+
/* Essential things */
igt_subtest("rte")
basic_subtest();