From c23de0aacbeaa7a091609b35764bed931475a16d Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 9 Dec 2016 08:18:27 +0100 Subject: support: Introduce new subdirectory for test infrastructure The new test driver in 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). 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. --- Makeconfig | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'Makeconfig') diff --git a/Makeconfig b/Makeconfig index e9d8da9..be45c3a 100644 --- a/Makeconfig +++ b/Makeconfig @@ -394,6 +394,9 @@ ifndef after-link after-link = endif +# Additional libraries to link into every test. +link-extra-libs-tests = $(libsupport) + # Command for linking PIE programs with the C library. ifndef +link-pie +link-pie-before-libc = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \ @@ -412,8 +415,8 @@ $(+link-pie-before-libc) $(rtld-LDFLAGS) $(link-libc) $(+link-pie-after-libc) $(call after-link,$@) endef define +link-pie-tests -$(+link-pie-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \ - $(+link-pie-after-libc) +$(+link-pie-before-libc) $(link-extra-libs-tests) \ + $(rtld-tests-LDFLAGS) $(link-libc-tests) $(+link-pie-after-libc) $(call after-link,$@) endef define +link-pie-printers-tests @@ -439,7 +442,8 @@ $(+link-static-before-libc) $(link-libc-static) $(+link-static-after-libc) $(call after-link,$@) endef define +link-static-tests -$(+link-static-before-libc) $(link-libc-static-tests) $(+link-static-after-libc) +$(+link-static-before-libc) $(link-extra-libs-tests) \ + $(link-libc-static-tests) $(+link-static-after-libc) $(call after-link,$@) endef endif @@ -468,8 +472,8 @@ $(+link-before-libc) $(rtld-LDFLAGS) $(link-libc) $(+link-after-libc) $(call after-link,$@) endef define +link-tests -$(+link-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \ - $(+link-after-libc) +$(+link-before-libc) $(link-extra-libs-tests) \ + $(rtld-tests-LDFLAGS) $(link-libc-tests) $(+link-after-libc) $(call after-link,$@) endef define +link-printers-tests @@ -545,7 +549,7 @@ link-libc-printers-tests = $(link-libc-rpath) \ $(link-libc-tests-after-rpath-link) # This is how to find at build-time things that will be installed there. -rpath-dirs = math elf dlfcn nss nis rt resolv crypt mathvec +rpath-dirs = math elf dlfcn nss nis rt resolv crypt mathvec support rpath-link = \ $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%))) else # build-static @@ -892,7 +896,7 @@ libio-include = -I$(..)libio # List of non-library modules that we build. built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage \ libSegFault libpcprofile librpcsvc locale-programs \ - memusagestat nonlib nscd extramodules libnldbl + memusagestat nonlib nscd extramodules libnldbl libsupport in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \ $(libof-$(