mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
support: Introduce new subdirectory for test infrastructure
The new test driver in <support/test-driver.c> has feature parity with the old one. The main difference is that its hooking mechanism is based on functions and function pointers instead of macros. This commit also implements a new environment variable, TEST_COREDUMPS, which disables the code which disables coredumps (that is, it enables them if the invocation environment has not disabled them). <test-skeleton.c> defines wrapper functions so that it is possible to use existing macros with the new-style hook functionality. This commit changes only a few test cases to the new test driver, to make sure that it works as expected.
This commit is contained in:
@@ -16,9 +16,11 @@
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <support/support.h>
|
||||
|
||||
#define SIZE 4096
|
||||
|
||||
/* Wrap free with a function to prevent gcc from optimizing it out. */
|
||||
@@ -30,13 +32,6 @@ call_free (void *ptr)
|
||||
*(size_t *)(ptr - sizeof (size_t)) = 1;
|
||||
}
|
||||
|
||||
int do_test (void);
|
||||
|
||||
#define TEST_FUNCTION do_test ()
|
||||
#define EXPECTED_SIGNAL SIGABRT
|
||||
|
||||
#include "../test-skeleton.c"
|
||||
|
||||
int
|
||||
do_test (void)
|
||||
{
|
||||
@@ -53,3 +48,6 @@ do_test (void)
|
||||
doesn't optimize out that malloc call. */
|
||||
return (ptr1 == ptr2);
|
||||
}
|
||||
|
||||
#define EXPECTED_SIGNAL SIGABRT
|
||||
#include <support/test-driver.c>
|
||||
|
Reference in New Issue
Block a user