]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/commitdiff
tests: Fix tests when running under coloredstderr.
authorSimon Ruderich <simon@ruderich.org>
Mon, 10 Jun 2013 20:49:58 +0000 (22:49 +0200)
committerSimon Ruderich <simon@ruderich.org>
Mon, 10 Jun 2013 20:49:58 +0000 (22:49 +0200)
tests/run.sh

index b57122cee2c4bf98f140707161cb950fdcfd44d6..ee26896c7bc12465d749b13cf330749cefe34b7a 100755 (executable)
 set -e
 
 
+# The tests fail if running under coloredstderr because the tests redirect
+# stderr to stdout which is detected by coloredstderr :D (and not colored as a
+# result). Therefore remove LD_PRELOAD and re-exec the test.
+if test -n "$LD_PRELOAD"; then
+    unset LD_PRELOAD
+    exec "$0"
+fi
+
 test "x$srcdir" = x && srcdir=.
 . "$srcdir/lib.sh"