support: Introduce new subdirectory for test infrastructure

Message ID 4839ff08-b363-cc7f-cdb8-2353fe139cba@redhat.com
State New
Headers show

Commit Message

Florian Weimer Dec. 12, 2016, 10 a.m.
On 12/10/2016 08:39 PM, Andreas Schwab wrote:
> On Dez 10 2016, Florian Weimer <fweimer@redhat.com> wrote:

>

>> Even before, not all test dependencies were properly encoded.

>

> Which ones?


I don't remember.  I assumed it was expected.  I'll report it the next 
time I see it.

>> I don't want to avoid doing the work.  I just don't know what make

>> behavior is expected here.

>

> If libsupport*.a changes, then all tests need to be relinked.


I came up with the attached patch to implement this.  Is it what you had 
in mind?

Thanks,
Florian

Comments

Andreas Schwab Dec. 12, 2016, 6:15 p.m. | #1
On Dez 12 2016, Florian Weimer <fweimer@redhat.com> wrote:

> 	* Rules (binaries-shared-tests, binaries-pie-tests)

> 	(binaries-static-tests): Link with $(link-extra-libs-tests).

> 	* Makeconfig (+link-pie-tests, +link-static-tests, +link-tests):

> 	Remove $(link-extra-libs-tests).


Ok.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Patch

Expose linking against libsupport as make dependency

This ensures that tests are rebuilt when libsupport changes.

2016-12-12  Florian Weimer  <fweimer@redhat.com>

	* Rules (binaries-shared-tests, binaries-pie-tests)
	(binaries-static-tests): Link with $(link-extra-libs-tests).
	* Makeconfig (+link-pie-tests, +link-static-tests, +link-tests):
	Remove $(link-extra-libs-tests).

diff --git a/Makeconfig b/Makeconfig
index be45c3a..2d316ac 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -415,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) $(link-extra-libs-tests) \
-  $(rtld-tests-LDFLAGS) $(link-libc-tests) $(+link-pie-after-libc)
+$(+link-pie-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
+			 $(+link-pie-after-libc)
 $(call after-link,$@)
 endef
 define +link-pie-printers-tests
@@ -442,8 +442,7 @@  $(+link-static-before-libc) $(link-libc-static) $(+link-static-after-libc)
 $(call after-link,$@)
 endef
 define +link-static-tests
-$(+link-static-before-libc) $(link-extra-libs-tests) \
-  $(link-libc-static-tests) $(+link-static-after-libc)
+$(+link-static-before-libc) $(link-libc-static-tests) $(+link-static-after-libc)
 $(call after-link,$@)
 endef
 endif
@@ -472,8 +471,8 @@  $(+link-before-libc) $(rtld-LDFLAGS) $(link-libc) $(+link-after-libc)
 $(call after-link,$@)
 endef
 define +link-tests
-$(+link-before-libc) $(link-extra-libs-tests) \
-  $(rtld-tests-LDFLAGS) $(link-libc-tests) $(+link-after-libc)
+$(+link-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
+		     $(+link-after-libc)
 $(call after-link,$@)
 endef
 define +link-printers-tests
diff --git a/Rules b/Rules
index de58a64..9e02eb7 100644
--- a/Rules
+++ b/Rules
@@ -189,6 +189,7 @@  endif
 
 ifneq "$(strip $(binaries-shared-tests))" ""
 $(addprefix $(objpfx),$(binaries-shared-tests)): %: %.o \
+  $(link-extra-libs-tests) \
   $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
   $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
 	$(+link-tests)
@@ -196,6 +197,7 @@  endif
 
 ifneq "$(strip $(binaries-pie-tests))" ""
 $(addprefix $(objpfx),$(binaries-pie-tests)): %: %.o \
+  $(link-extra-libs-tests) \
   $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
   $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
 	$(+link-pie-tests)
@@ -217,6 +219,7 @@  endif
 
 ifneq "$(strip $(binaries-static-tests))" ""
 $(addprefix $(objpfx),$(binaries-static-tests)): %: %.o \
+  $(link-extra-libs-tests) \
   $(sort $(filter $(common-objpfx)lib%,$(link-libc-static-tests))) \
   $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
 	$(+link-static-tests)