14 Commits

Author SHA1 Message Date
Daniel Vetter
c9c554594e tests: run igt.cocci
Re-run with correct igt_fail rules. Again manually fixup missing
includes for igt_core.h.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:27:59 +02:00
Daniel Vetter
943511a3ab tests/gem_reg_read: Fix errno check
So I accidentally fixed a check when converting to the new macros and
the kernel never returned -ENOENT for invalid regs. Adjust the test.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-15 14:25:47 +02:00
Daniel Vetter
0b7ce4ac29 tests: Use igt macros more
Often just folding together of the common if (cond) printf;
abort|igt_skip|igt_fail; pattern. But in a few cases I've ripped out
more since the igt macros will already print the condition and errno.

A few tests where more work (like ripping out return codes en masse)
is needed left as-is.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 09:56:53 +02: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
e49ceb8690 lib: unnecessary header removal for drmtest.h, part 1
Brought a few missing headers to light in ioctl_wrappers.h, too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 21:07:37 +01:00
Daniel Vetter
dda85fb108 tests: roll out igt_simple_init/igt_simple_main
Also use igt_skip a bit more to simplify some of the tests.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-10 10:18:32 +01:00
Daniel Vetter
8f5387eb99 tests: introduce igt_require
Since igt_skip has funny control flow we can abuse it and make it work
like a special kind of assert which automatically skips tests if a
requirement fails.

Note that in places where we have a less strict test which should
always succeed (e.g. ioctl works or isn't available) the igt_assert
should be place before the igt_require with the more strict
requirements. Otherwise we'll skip a test instead of properly failing
it.

Convert a few users of igt_skip over to igt_require to showcase its
use.

v2: s/gem_check_/gem_require_/ so that we consistently use "require"
to indicate magic check that can call igt_skip. Imo hiding the
igt_require for feature checks is ok, but for more traditional assert
like use cases an explicit igt_require might be better.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:15:18 +02:00
Daniel Vetter
5e25fcc285 tests: use igt_fail instead of exit(param != 0)
Mostly a sed job with too manual fixups:
- one case of using _exit instead of exit
- and one case which under some conditions use 77, so convert that
  check to an igt_skip.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:15:17 +02:00
Daniel Vetter
c9d0378281 tests: s/exit(EXIT_SUCCESS)/igt_success()/
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:07:44 +02:00
Daniel Vetter
a4cb8954b2 tests: s/exit(EXIT_FAILURE)/igt_fail(1)/
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:07:44 +02:00
Chris Wilson
2e1c11546a gem_reg_read: Only check errno after a definite error
As upon success, errno is invalid and may give spurious false results.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65157
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-30 08:40:43 +01:00
Imre Deak
bcfc0f1e4b fix warn in gem_reg_read: 'read' shadows a global declaration
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:14 +02:00
Daniel Vetter
81f16261f4 tests/gem_reg_read: actually wait a bit between reading TIMESTAMP reg
QA could only hit this on ilk because the timer increase quite a bit
slower on that platform than on gen6+ (80ns vs 320ns, iirc).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52937
2012-08-05 21:40:56 +02:00
Daniel Vetter
fb748aad4c tests: s/drm_reg_read/gem_reg_read
gem_ is the prefix for low-level kernel tests, drm_ tests
libdrm_intel specific stuff.
2012-07-23 09:52:10 +02:00