diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-10-16 14:12:49 +0200 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-10-16 14:12:49 +0200 |
| commit | 0412f32670642f88bf6de6afce9179eefe608f13 (patch) | |
| tree | 84a558d76ea3a6e25204f0e77e9c4cc063538d28 | |
| parent | 4ba97ddf96136d463e5b584fe997d6de698c0a74 (diff) | |
tests/debugfs_pipe_crc: correctly skip on unsupported platforms
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
| -rw-r--r-- | tests/debugfs_pipe_crc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/debugfs_pipe_crc.c b/tests/debugfs_pipe_crc.c index ff00361f..9884fd72 100644 --- a/tests/debugfs_pipe_crc.c +++ b/tests/debugfs_pipe_crc.c @@ -199,6 +199,10 @@ int main(int argc, char **argv) igt_subtest_init(argc, argv); igt_fixture { + size_t written; + int ret; + const char *cmd = "pipe A none"; + data.drm_fd = drm_open_any(); do_or_die(igt_set_vt_graphics_mode()); do_or_die(igt_install_exit_handler(exit_handler)); @@ -208,8 +212,12 @@ int main(int argc, char **argv) igt_debugfs_init(&data.debugfs); data.ctl = igt_debugfs_fopen(&data.debugfs, "i915_display_crc_ctl", "r+"); - if (!data.ctl) - igt_skip("No display_crc_ctl found, kernel too old\n"); + igt_require_f(data.ctl, + "No display_crc_ctl found, kernel too old\n"); + written = fwrite(cmd, 1, strlen(cmd), data.ctl); + ret = fflush(data.ctl); + igt_require_f((written == strlen(cmd) && ret == 0) || errno != ENODEV, + "CRCs not supported on this platform\n"); } igt_subtest("bad-pipe") |
