summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2010-12-10 12:18:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2010-12-10 12:18:29 +0000
commita90c5041656e490bebd8d373b6da11baf8dcbe24 (patch)
tree9255b89912ddf96339827945018b063d2929e20b /desktop
parentb02ee6a46cfa9ac5a565cc1122ffeffd89a68724 (diff)
make it easy to valgrind the smoketest
Diffstat (limited to 'desktop')
-rw-r--r--desktop/scripts/soffice.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 0604be96f39c..9b8c0dd828e9 100644
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -60,6 +60,13 @@ if [ -e ooenv ] ; then
. ./ooenv
fi
+if [ "$VALGRIND" != "" ]; then
+ VALGRINDCHECK="valgrind --tool=$VALGRIND --error-exitcode=101"
+ export VALGRINDCHECK
+ G_SLICE=malloc
+ export G_SLICE
+fi
+
sd_binary=`basename "$0" | sed 's/libreoffice/soffice/g'`.bin
case "`uname -s`" in
@@ -102,7 +109,7 @@ if [ "$sd_binary" = "soffice.bin" -a -x "$sd_prog/oosplash.bin" ] && [ "$no_oosp
sd_binary="oosplash.bin"
# try to connect to a running instance early
- if "$sd_prog/$sd_binary" -qsend-and-report "$@" ; then
+ if $VALGRINDCHECK "$sd_prog/$sd_binary" -qsend-and-report "$@" ; then
exit 0
fi
fi
@@ -165,7 +172,7 @@ if [ -f /etc/adabasrc ]; then
fi
# execute soffice binary
-"$sd_prog/$sd_binary" "$@" &
+$VALGRINDCHECK "$sd_prog/$sd_binary" "$@" &
trap 'kill -9 $!' TERM
wait $!
sd_ret=$?
@@ -173,9 +180,9 @@ sd_ret=$?
while [ $sd_ret -eq 79 -o $sd_ret -eq 81 ]
do
if [ $sd_ret -eq 79 ]; then
- "$sd_prog/$sd_binary" ""$BOOTSTRAPVARS"" &
+ $VALGRINDCHECK "$sd_prog/$sd_binary" ""$BOOTSTRAPVARS"" &
elif [ $sd_ret -eq 81 ]; then
- "$sd_prog/$sd_binary" "$@" &
+ $VALGRINDCHECK "$sd_prog/$sd_binary" "$@" &
fi
wait $!