]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - test/run-stp-tests.sh
Merge changes from CUPS 1.6svn-r10002
[thirdparty/cups.git] / test / run-stp-tests.sh
index fa943fc95b644d86a3c0be0923d2914e053e3665..255f3066db59545d44c11164bc43b9ea47902d10 100755 (executable)
@@ -212,6 +212,43 @@ case "$usevalgrind" in
                ;;
 esac
 
+#
+# See if we want to do debug logging of the libraries...
+#
+
+echo ""
+echo "If CUPS was built with the --enable-debug-printfs configure option, you"
+echo "can enable debug logging of the libraries."
+echo ""
+echo $ac_n "Enter Y or a number from 0 to 9 to enable debug logging or N to not: [N] $ac_c"
+
+if test $# -gt 0; then
+       usedebugprintfs=$1
+       shift
+else
+       read usedebugprintfs
+fi
+echo ""
+
+case "$usedebugprintfs" in
+       Y* | y*)
+               echo "Enabling debug printfs; log files can be found in /tmp/cups-$user/log..."
+               CUPS_DEBUG_LOG="/tmp/cups-$user/log/debug_printfs.%d"; export CUPS_DEBUG_LOG
+               CUPS_DEBUG_LEVEL=5; export CUPS_DEBUG_LEVEL
+               CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cups.*Request|cupsGetRespond|cupsSend).*$'; export CUPS_DEBUG_FILTER
+               ;;
+
+       0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9)
+               echo "Enabling debug printfs; log files can be found in /tmp/cups-$user/log..."
+               CUPS_DEBUG_LOG="/tmp/cups-$user/log/debug_printfs.%d"; export CUPS_DEBUG_LOG
+               CUPS_DEBUG_LEVEL=$usedebugprintf; export CUPS_DEBUG_LEVEL
+               CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cups.*Request|cupsGetRespond|cupsSend).*$'; export CUPS_DEBUG_FILTER
+               ;;
+
+       *)
+               ;;
+esac
+
 #
 # Start by creating temporary directories for the tests...
 #
@@ -338,6 +375,7 @@ CacheDir /tmp/cups-$user/share
 DataDir /tmp/cups-$user/share
 FontPath /tmp/cups-$user/share/fonts
 PassEnv LOCALEDIR
+PassEnv DYLD_INSERT_LIBRARIES
 DocumentRoot $root/doc
 RequestRoot /tmp/cups-$user/spool
 TempDir /tmp/cups-$user/spool/temp
@@ -421,7 +459,7 @@ fi
 
 export LD_LIBRARY_PATH
 
-LD_PRELOAD="$root/cups/libcups.so.2:$root/filter/libcupsimage.so.2:$root/cgi-bin/libcupscgi.so.1:$root/scheduler/libcupsmime.so.1:$root/driver/libcupsdriver.so.1:$root/ppdc/libcupsppdc.so.1"
+LD_PRELOAD="$root/cups/libcups.so.2:$root/filter/libcupsimage.so.2:$root/cgi-bin/libcupscgi.so.1:$root/scheduler/libcupsmime.so.1:$root/ppdc/libcupsppdc.so.1"
 if test `uname` = SunOS -a -r /usr/lib/libCrun.so.1; then
        LD_PRELOAD="/usr/lib/libCrun.so.1:$LD_PRELOAD"
 fi
@@ -476,8 +514,8 @@ echo "    $valgrind ../scheduler/cupsd -c /tmp/cups-$user/cupsd.conf -f >/tmp/cu
 echo ""
 
 if test `uname` = Darwin -a "x$valgrind" = x; then
-       DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib \
-       $valgrind ../scheduler/cupsd -c /tmp/cups-$user/cupsd.conf -f >/tmp/cups-$user/log/debug_log 2>&1 &
+       DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib
+       ../scheduler/cupsd -c /tmp/cups-$user/cupsd.conf -f >/tmp/cups-$user/log/debug_log 2>&1 &
 else
        $valgrind ../scheduler/cupsd -c /tmp/cups-$user/cupsd.conf -f >/tmp/cups-$user/log/debug_log 2>&1 &
 fi