RFC: test-in-container vs ld.so
Commit Message
Florian Weimer <fw@deneb.enyo.de> writes:
> I suspect the removalof LC_*, LANG etc. variables should be done in
> test-container, just for convenience.
This is what I ended up with. All tests pass, but as I mentioned in a
previous email, very few tests run in the container. This blocks the
outer variables from coming in, while letting the test itself set them
again if needed.
I'm not sure what kind of test we could run in the container to make
sure we're *not* accidentally using the build-tree file, though.
@@ -275,8 +275,8 @@ $(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence.
# tests-container.
$(tests-container:%=$(objpfx)%.out): $(objpfx)%.out : $(if $(wildcard $(objpfx)%.files),$(objpfx)%.files,/dev/null) $(objpfx)%
$(test-wrapper-env) $(run-program-env) $(run-via-rtld-prefix) \
- $(common-objpfx)support/test-container env $(run-program-env) $($*-ENV) \
- $(host-test-program-cmd) $($*-ARGS) > $@; \
+ $(common-objpfx)support/test-container env $($*-ENV) \
+ $(built-program-file) $($*-ARGS) > $@; \
$(evaluate-test)
@@ -712,6 +712,12 @@ main (int argc, char **argv)
--argc;
}
+ /* We don't want to inherit these from the ld.so wrapper we were
+ invoked with, but the test can still provide a test-specific
+ value via the "env" we pretend to run. */
+ unsetenv ("GCONV_PATH");
+ unsetenv ("LOCPATH");
+
if (strcmp (argv[1], "env") == 0)
{
++argv;