tests: skip rc6_residency test if not supported

Fixes spurious failures.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2012-04-12 23:12:24 +02:00
parent 5ce86f88a0
commit de9d98bb6e

View File

@ -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);