]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid spurious failure when run via valgrind
authorJim Meyering <meyering@redhat.com>
Thu, 10 Dec 2009 07:17:02 +0000 (08:17 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 10 Dec 2009 15:50:05 +0000 (16:50 +0100)
* tests/misc/printenv: Ignore LD_PRELOAD differences.

tests/misc/printenv

index c2bd2e424d0bc7350bec1c1a44a7fe5ed7b4e060..a56e9c76d920cab53e89b5ef04c8b178c7c024c7 100755 (executable)
@@ -25,10 +25,11 @@ fi
 
 
 # Without arguments, printenv behaves like env.  Some shells provide
-# printenv as a builtin, so we must test via absolute name.
+# printenv as a builtin, so we must invoke it via "env".
 # But beware of $_, set by many shells to the last command run.
-env | grep -v '^_' > exp || framework_failure
-env -- printenv | grep -v '^_' > out || fail=1
+# Also, filter out LD_PRELOAD, which is set when running under valgrind.
+env | grep -Ev '^(_|LD_LIBRARY=)' > exp || framework_failure
+env -- printenv | grep -Ev '^(_|LD_LIBRARY=)' > out || fail=1
 compare exp out || fail=1
 
 # POSIX is clear that environ may, but need not be, sorted.