aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test-runner.h
Commit message (Collapse)AuthorAgeFilesLines
* tests: Remove memory leak checking infrastructureDaniel Stone2018-08-291-8/+5
| | | | | | | | | | | | | There are far better ways to detect memory leaks, such as either valgrind or ASan. Having Meson makes it really easy to use these tools in our tests, and we can do that in CI as well. Having these local wrappers actually completely broke ASan usage, so remove them in favour of using the more powerful options. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
* tests: disable coredumps on sanity-testPekka Paalanen2018-03-151-0/+3
| | | | | | | | | | | | SEGV and ABRT by default cause a core dump, which may create a file, launch crash handlers, and so on. sanity-test has 21 processes that are expected to crash like this. Disable core dumps on them all. I counted 21 entries in coredumpctl list, while only 16 functions needed patching. After this patch no entries appear in coredumpctl list. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>
* tests: Mark tests used so they don’t get removed at link timeEmmanuel Gil Peyrot2017-12-011-2/+2
| | | | | | | | | | | Without this attribute, these macros were making Weston’s tests fail to build with LTO enabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94602 Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de> Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Tested-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* tests: Add one more indentation level to some macrosEmmanuel Gil Peyrot2017-12-011-16/+16
| | | | | | | This is a preparatory patch for the next one. Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* test-runner: Add copyright boilerplate for .h, same as the .cBryce Harrington2015-06-121-0/+24
| | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: add possibility to disable leak check for single testMarek Chalupa2015-01-281-0/+6
| | | | | | | | | | In tests that are using external libraries (i. e. pthread) we can get failure because of leaks in the external library. Until we have some better solution (if ever), let these (and only these) tests to disable leak checks. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* test-runner: move leak checking into functionMarek Chalupa2015-01-281-0/+6
| | | | | | | | 1) now we can use it in the test-compositor 2) it looks better Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* tests: add test_usleep and test_sleep functionsMarek Chalupa2014-11-171-0/+12
| | | | | | | | | The former one was already used in tests, but was private. These functions can be shared across the tests, so make them public. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: add timeoutMarek Chalupa2014-11-171-0/+7
| | | | | | | | | | | | | | | | Add test_set_timeout() function that allows the test to set timeout for its completition. Any other call to the function re-sets the timeout to the new value. The timeouts can be turned off (usefull when debugging) by setting evironment variable WAYLAND_TESTS_NO_TIMEOUTS. v2: rename NO_TIMEOUTS to WAYLAND_TESTS_NO_TIMEOUTS use unsigned int as argument of test_set_timeout() improve printing of the message about timeout Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: support testing fd inheritance over execPekka Paalanen2012-04-201-0/+3
| | | | | | | Add facility for testing how (many) file descriptors survive an exec. This allows implementing O_CLOEXEC tests. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
* tests: detect fd leaksPekka Paalanen2012-04-201-0/+3
| | | | | | | | Detect file descriptor leaks in tests. Add a sanity test to verify that we catch the leaks. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
* tests: add support for tests expected to failPekka Paalanen2012-04-191-3/+14
| | | | | | | | | | | | | | | | | Add a new macro FAIL_TEST that can be used to define tests that are supposed to fail. To distinguish the supposed outcome of a test, add a field to 'struct test'. However, simply adding a field to 'struct test' will make all tests past the first one in an executable to be garbage. Apparently, the variables of type 'struct test' have different alignment when put into a special section than otherwise, and the compiler will get the skip from one 'struct test' to the next wrong. Explicitly specify the alingment of 'struct test' to be 16 bytes, which is what it seems to be in the special section on x86_64. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
* tests: fail build if NDEBUG is definedPekka Paalanen2012-04-191-0/+4
| | | | Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
* Add simple memory leak check to all tests.U. Artie Eoff2012-03-241-0/+5
| | | | | | | | | Wrap all tests with a memory balance check to detect potential memory leaks. Fixed a few tests that had memory leaks contained in the tests themselves. Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* tests: Add Unit tests for wl_map and wl_array data structuresKristian Høgsberg2012-03-021-0/+14
We use a simple test-runner helper that runs each test in a separate process and reports the pass/fail rate at the end.