20 Commits

Author SHA1 Message Date
Daniel Vetter
f3c54d0cb4 tests: use igt_assert/igt_require more
With the new _f variants we can replace almost all of them.

Also remove a ton of checks for argc != 1, they're a bit useless ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-25 14:37:07 +02:00
Daniel Vetter
b3880d3a96 tests: roll out igt_fixture
Also sprinkle igt_assert and igt_require over the setup code to clean
up code while at it. To avoid gcc getting upset about unitialized
variables just move them out of main as global data (where they always
get initialized to 0) - gcc can't see through our igt_fixture and
igt_subtest maze properly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 18:02:46 +02:00
Daniel Vetter
6234658063 tests: add igt_subtest_f for snprintf'ing testnames
Useful when stitching together combinatorial testnames.

v2:
- ## rules are just fun. We need 2 indirections to actually get
  __LINE__ to properly expand.
- Kill stray ; which botched the logic.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 13:47:47 +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
83440953e5 tests: s/assert/igt_assert
Just a wholesale rollout for now, we can refine later on.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:07:44 +02:00
Daniel Vetter
6877877558 tests: s/return igt_retval();/igt_exit();/
Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:26:35 +02:00
Daniel Vetter
1caaf0a6b6 s/drmtest_/igt_/
Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:20:22 +02:00
Daniel Vetter
814b135541 s/drmtest_subtest_block/drmtest_subtest/
The _block postfix meant to convey that a C statement/block must
follow can be misread as the verb to block. So drop it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:15:16 +02:00
Daniel Vetter
7553ad6e10 tests: use drmtest_skip() in caching ioctl helpers
This way we can rip out all the skip handling from the test control flow,
and additionally (by using drmtest_retval()) even get correct exit codes.

The only tricky part is that when we only want ot skip parts of a test
(like for gem_pread and gem_pwrite) we need to split out those parts as
subtests. But no addition of control-flow is required, the set/longjmp
magic in the helpers all makes it happen.

Also we make extensive use of the behaviour of drmtest_skip to skip
all subsequent subtests if it is called outside of a subtest. This allows
us to re-flatten the control flow a lot.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:17:58 +02:00
Daniel Vetter
9f6365e4ea lib/drmtest: Add drmtest_subtest_block macro
Doesn't do more than an if (drmtest_run_test(name)) right now, but
as soon as we get a bit of infrastructure to handle test failures and
skipping, this will get more interesting.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:10:26 +02:00
Daniel Vetter
40ea6f4ea8 tests: s/cacheing/caching
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:10:26 +02:00
Chris Wilson
467796acc8 Expand gem_set_cacheing testing to handle the proposed DISPLAY domain 2013-08-10 15:49:33 +01:00
Chris Wilson
a661c098b0 gem_partial_pwrite_pread: Exercise different cacheing of the staging bo 2013-08-06 16:58:59 +01:00
Damien Lespiau
5fa15f79d0 tests: Black list tests we don't want to run on simulation
Let's start by a small set of tests, to eventually consider running
more.

The current list should then be:

gem_mmap
gem_pread_after_blit
gem_ring_sync_loop
gem_ctx_basic
gem_pipe_control_store_loop
gem_storedw_loop_render
gem_storedw_loop_blt
gem_storedw_loop_bsd
gem_render_linear_blits
gem_tiled_blits
gem_cpu_reloc

gem_exec_nop
gem_mmap_gtt

v2 add (Daniel Vetter)
gem_exec_bad_domains
gem_exec_faulting_reloc
gem_flink
gem_reg_read
gem_reloc_overflow
gem_tiling_max_stride
prime_*

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:49:02 +01:00
Daniel Vetter
046b149b18 tests/gem_partial_pwrite_pread: convert to subtest infrastructure 2012-11-28 13:08:07 +01:00
Daniel Vetter
1a55ca753e tests/gem_partial_pwrite_pread: refactor subtests into functions
This was a too big mess.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-28 12:47:26 +01:00
Daniel Vetter
36a40a5423 gem_partial_pwrite_pread: add progress indicator
Without optimized pread/pwrite this test takes forever.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-31 13:52:59 +01:00
Daniel Vetter
d75d69d0a9 lib/drmtest: extract mappable aperture trasher infrastructure
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-15 18:32:11 +01:00
Daniel Vetter
ff409c537f tests/gem_partial_pwrite_pread: don't trash gtt unnecessarily
On chips that don't have a unmappable gtt part it's utterly pointless.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-06 16:57:53 +01:00
Daniel Vetter
5a851b1392 tests: add gem_partial_pwrite_pread
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-04 21:45:12 +01:00