diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-04-12 23:12:24 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-04-12 23:12:24 +0200 |
commit | de9d98bb6e8736907458a28921aee5fcc507ca6d (patch) | |
tree | 12ac80cb44c539f3197504b3198a8f4cd9a7841a | |
parent | 5ce86f88a0a9b24564a6349a70de5797b814b108 (diff) |
tests: skip rc6_residency test if not supported
Fixes spurious failures.
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | tests/sysfs_rc6_residency.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/sysfs_rc6_residency.c b/tests/sysfs_rc6_residency.c index 3fcdbeb7..2f33697a 100644 --- a/tests/sysfs_rc6_residency.c +++ b/tests/sysfs_rc6_residency.c @@ -57,6 +57,7 @@ int main(int argc, char *argv[]) char *path, *pathp, *pathpp; int fd, ret; unsigned int value1, value1p, value1pp, value2, value2p, value2pp; + FILE *file; int diff; /* Use drm_open_any to verify device existence */ @@ -70,6 +71,13 @@ int main(int argc, char *argv[]) * Let's add a sleept just to make it happy. */ sleep(5); + file = fopen(path, "r"); + if (!file) { + printf("kernel too old or rc6 not supported on this platform.\n"); + exit(77); + } + + /* claim success if no rc6 enabled. */ if (readit(path) == 0) exit(EXIT_SUCCESS); |