Commit Graph

19 Commits

Author SHA1 Message Date
Alexandros Frantzis
d4d3228853 tests: Capture the test client log
Capture the test client log to a temporary fd, so that is accessible by both
the test server process and the test client process.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2023-02-28 11:22:04 +00:00
Derek Foreman
ea237db7f6 tests: Fix tc_client_fd_leaks_exec test
tc_client_fd_leaks and tc_client_fd_leaks_exec are currently the exact
same test. It seems clear from the name that the latter was intended to
spawn sanity_fd_leak_exec instead of sanity_fd_leak.

Fixes #121

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2022-01-10 09:52:00 +00:00
Daniel Stone
01095a9ce4 tests: Remove memory leak checking infrastructure
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>
2018-08-29 09:59:04 +01:00
Daniel Stone
9575d1c772 tests: Use volatile pointer for NULL dereference
Clang warns that it can silently discard a non-volatile write to a NULL
pointer (perhaps it constitutes undefined behaviour?), and recommends
changing it to volatile.

This patch slavishly complies with the demand of the unfeeling machine.

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>
2018-08-29 09:59:04 +01:00
Pekka Paalanen
371c26d52b tests: disable coredumps on sanity-test
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>
2018-03-15 14:59:24 +02:00
Jonas Ådahl
046012a6cf tests: Pass argument to client main
Change the API to pass an "void *" argument to the client main
function, allowing the caller to call the same main function with
different input.

A helper (client_create_noarg) is added for when no argument is passed,
and the existing test cases are changed to use this function instead.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-01-16 16:37:37 +08:00
Marek Chalupa
c7bada036d add wl_abort private function
On many places in the code we use wl_log + abort or wl_log + assert(0).
Replace these with one call to wl_abort, so that we don't mix abort(),
assert(0) and we'll save few lines

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-11-16 12:58:43 -08:00
Bryce Harrington
773babedfc tests: Update boilerplate from MIT X11 license to MIT Expat license
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-12 15:31:24 -07:00
Marek Chalupa
68c11c48c0 tests: add possibility to disable leak check for single test
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>
2015-01-28 17:17:22 +00:00
Marek Chalupa
d1855797d3 tests: add tests for leak check in clients
Sanity tests for leak checks in clients of test compositor
and also check if the test-compositor itself is not leaking
anything.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-01-28 17:17:09 +00:00
Marek Chalupa
1d2ef9ee08 tests: add timeout tests
sanity tests for timeouts.

v2:
  use test_sleep instead of sleep
  add few more test-cases

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-17 16:51:51 +02:00
U. Artie Eoff
91931bcabb tests: ensure sanity leak check tests pass when leak checks are disabled.
This finalizes Robert Bradfords patch to allow NO_ASSERT_LEAK_CHECK
environment variable to disable leak checks in unit tests.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-08-29 14:10:24 -04:00
Dylan Noblesmith
b486e3aba5 tests: fix make check for out-of-tree builds
It was failing with missing include files.

While here, destroy the ugly "../src/..." include
paths used in the tests that was just hacking around
this problem in the Makefile:

sed -i s/..\\/src\\/// tests/*.c
2012-06-30 19:58:37 +00:00
Pekka Paalanen
2ccaf918ab tests: silence warnings from pipe()
warning: ignoring return value of ‘pipe’, declared with attribute
warn_unused_result

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-25 09:32:58 +03:00
Pekka Paalanen
da6b1a8e47 tests: support testing fd inheritance over exec
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>
2012-04-20 15:06:27 +03:00
Pekka Paalanen
e0561ac68d tests: detect fd leaks
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>
2012-04-20 14:58:31 +03:00
Kristian Høgsberg
d44074900d tests: Add more sanity test to make sure we catch different failure modes 2012-04-19 12:37:40 -04:00
Kristian Høgsberg
41570a5ed9 tests: Make sure unused malloc() doesn't get optimized away 2012-04-19 12:07:20 -04:00
Pekka Paalanen
55489883c4 tests: add sanity-test
Test the testing framework itself, so that it catches the errors we
expect it to.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-19 14:46:52 +03:00