8 Commits

Author SHA1 Message Date
Tim Gore
f33fa71481 lib/igt_core: make single/simple tests use igt_exit
Currently tests that use igt_simple_main will simply call
"exit()" if they pass, making it difficult to ensure that
any required cleanup is done. At present this is not an
issue, but it will be when I submit a patch to turn off the
lowmemorykiller for all tests.

Signed-off-by: Tim Gore <tim.gore@intel.com>
[danvet: Also update api docs.]
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-09-29 16:57:49 +02:00
Daniel Vetter
428060c555 lib/igt.cocci: Add s/assert/igt_assert/
People use it way too often, and it upsets the test library. The only
valid places to use this is of igt infrastructure self-tests where you
need to check something _without_ all the other abi use checks
igt_fail and friends do. For those tests just #define an internal
assert to hide it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-15 10:23:20 +02:00
Daniel Vetter
5a98fe9d4a lib: Add argc/argv to igt_simple_init
There's a pile of ideas around to add generally useful options like
--debug to all igt tests. Or unify the runtime behaviour between
simple and subtest tests a bit more.

The first step to get there is to add argc/argv to igt_simple_init so
that we can get at the argument list.

Cc: Tim Gore <tim.gore@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-14 15:03:59 +02:00
Thomas Wood
17eb062661 lib: add exit status defines
Add defines for success, skip and timeout exit statuses.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-05-14 12:33:02 +01:00
Daniel Vetter
71c6f87eb3 lib/igt_core: fix igt_skip_on_simulation regression
I've forgotten that we might want to call this from within specific
subtests (or special helpers like the autoresume one).

Also props for being competent enough to write a testcase, but
incompetent enough to botch the job up.

Fix both things and remove a leftover debug printf while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 15:09:23 +01:00
Daniel Vetter
254f19ba8d lib: unnecessary header removal for drmtest.h, part 2
I've left unistd.h in it - it's not strictly required but most users
of drmtest.h want it for the open helpers, and then you kinda need to
close that file descriptor again ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 21:29:01 +01:00
Daniel Vetter
0e22f14ed6 tests|lib: remove assert.h includes
Only the igt core and non-test tools should have asserts to catch
internal errors, tests and helper libraries should all user igt_asert
instead.

Fix things up where assert instead of igt_assert was used.

One tiny step towards header sanity.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 19:39:46 +01:00
Daniel Vetter
a388f3b98f lib: allow igt_skip_on_simulation outside of fixtures.
Thomas noticed that in simulation mode a lot of the tests fall over
instead of skipping properly. This is due to recently added
self-checks which ensure that any call to igt_skip happens either
within a fixture or subtest block (or it's a simple test without
subtests). This is to catch bugs since pretty much always not wrapping
up hardware setup and checks into these blocks is a bug.

Bug simulation skipping is a bit different, so allow that exception.
Otherwise we'd need to fix up piles of tests (and likely need to play
a game of whack-a-mole).

Also add a library testcase for all the different variants to make
sure it really works.

Cc: Thomas Wood <thomas.wood@intel.com>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 14:28:03 +01:00