lib/drmtest: skip/fail handling
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 12 Aug 2013 07:31:55 +0000 (09:31 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 12 Aug 2013 09:10:26 +0000 (11:10 +0200)
commitba0d2acf0ed9faf8025c54857db661d37c3a1339
tree4a4f6dd9453bcca4fadb15713bc029827a7e433f
parent9f6365e4eacc7aa07fc3f9524500d1e217b61bb5
lib/drmtest: skip/fail handling

Exitcode handling in igt testcases has too ugly facets in combination
with subtests:

- When individual subtest needed to be skipped for different reasons
  we need to painstakingly thread this information through the test to
  make sure that we still succeed if just one testcase worked (for
  running it with the simple automake test runner in igt). But it also
  needs to correctly report the skip exit value if only this one
  skipped testcase has been run (e.g. when run with piglit or in QA's
  test infrastructure).

- We'd prefer to easily skip (and also fail) subtests without
  hampering other subtests. Again threading the return value of each
  subtest through the code is cumbersome.

To simplify test case writing use longjmps to be able to get out of
subcases easily. But since longjmps are funny things thug it all away
into the newly added drmtest_subtest_block macro.

Note that if drmtest_skip is called outside of a subtest, but in a
testcase with subtests all subsequent subtests will be automatically
skipped.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
lib/drmtest.c
lib/drmtest.h