summaryrefslogtreecommitdiff
path: root/lib/igt.cocci
AgeCommit message (Collapse)Author
2015-10-07lib/igt.cocci: De-opencode ioctlsDaniel Stone
Use do_ioctl and do_ioctl_err where possible. Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07lib/igt.cocci: Add greater-than to igt_assert_lt*Daniel Stone
Change m >= n patterns to igt_assert_lte(n, m), and ditto for strict greater-than. Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-05-14igt.cocci: don't use igt_assert_neq to compare pointersThomas Wood
igt_assert_neq can only compare integers, not pointers. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14lib: add a define for test failure exit statusThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-26igt.cocci: check the return values of various functionsThomas Wood
Add rules to fix unused-result warnings when compiling with _FORTIFY_SOURCE defined and apply them to the library and tests. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-06igt.cocci: Replace igt_assert() with igt_assert_CMP() where possibleMatt Roper
The integer comparison macros give us better error output by including the actual values that failed the comparison. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13lib/igt_aux: s/swap/igt_swap/Daniel Vetter
It collides with the subtest naming convention glossary entry for swap. Which makes the docbook xml stuff unhappy. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-15lib: remove unnecessary checks on the drm_open_any return valueThomas Wood
drm_open_any always returns a valid file descriptor, so there is no need to check the return value. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-08lib/igt.cocci: Deal with min/max/swapVille Syrjälä
Replace open coded min/max/swap with the macro invocation. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-07-15lib/igt.cocci: Add s/assert/igt_assert/Daniel Vetter
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-11lib/igt.cocci: Add stanza for for_each_pipeDaniel Vetter
Damien dodged this ... Also run the script while at it. v2: Don't just capture identifiers for pipe, but also expressions. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13NEWS: Mention igt.cocciDaniel Vetter
And also pimp the spatch file itself with usage hints. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13lib: Introduce igt_fail_on/_fDaniel Vetter
I've yet again totally screwed things up (this time automated with cocci even, but not yet pushed luckily). So finally add a new version for easier conversion and adjust the cocci script. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13lib/igt.cocci: Also add rule to use igt_warn_on_fDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13lib/igt.cocci: Convert abort() to igt_failDaniel Vetter
abort should only be used for internal library checks - using abort() we get a "crash" result, using igt_fail we get "fail" in piglit. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13lib/igt.cocci: Conversion to igt loggingDaniel Vetter
Also update old hunks to match on igt logging instead of fprintf. v2: Don't forget about perror. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13tests: Don't use stderr for informational messagesDaniel Vetter
These should go to stdout instead. The next patch will clean this up with cocci, so no change from fprintf(stdout, to printf( here. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13lib: add igt.cocciDaniel Vetter
Small start but useful to collect refactorings/simplifications for common igt patterns. Please add more if you stumble over some so that we can occasionally run this to clean up the tests. I haven't figured out yet how to do the assert_cmpint->assert_eq transformation. Run this with spatch --sp-file lib/igt.cocci --in-place tests/*.c Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>