summaryrefslogtreecommitdiff
path: root/tests/twisted/tools/exec-with-log.sh
blob: e6e937988dc73f950e99ff79b84f200edda4f4ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

abs_top_srcdir="$1"
shift
abs_top_builddir="$1"
shift

cd "${abs_top_builddir}/tests"

export LC_ALL=C
export HAZE_DEBUG=all
G_MESSAGES_DEBUG=all
export G_MESSAGES_DEBUG
ulimit -c unlimited
exec >> haze-testing.log 2>&1

# Avoid using a non-trivial GSettings backend
GSETTINGS_BACKEND=memory
export GSETTINGS_BACKEND
# Avoid libpurple doing "clever" things
unset KDE_FULL_SESSION
unset KDEDIR
unset KDEDIRS
unset GNOME_DESKTOP_SESSION_ID

if test -n "$HAZE_TEST_VALGRIND"; then
        export G_DEBUG=${G_DEBUG:+"${G_DEBUG},"}gc-friendly
        export G_SLICE=always-malloc
        HAZE_WRAPPER="valgrind --leak-check=full --num-callers=20"
        HAZE_WRAPPER="$HAZE_WRAPPER --show-reachable=yes"
        HAZE_WRAPPER="$HAZE_WRAPPER --gen-suppressions=all"
        HAZE_WRAPPER="$HAZE_WRAPPER --child-silent-after-fork=yes"
        HAZE_WRAPPER="$HAZE_WRAPPER --suppressions=${abs_top_srcdir}/tools/tp-glib.supp"
elif test -n "$HAZE_TEST_REFDBG"; then
        if test -z "$REFDBG_OPTIONS" ; then
                export REFDBG_OPTIONS="btnum=10"
        fi
        if test -z "$HAZE_WRAPPER" ; then
                HAZE_WRAPPER="refdbg"
        fi
elif test -n "$HAZE_TEST_BACKTRACE"; then
        HAZE_WRAPPER="gdb -x ${abs_top_srcdir}/tools/run_and_bt.gdb"
fi

# not suitable for haze:
#export G_DEBUG=fatal-warnings" ${G_DEBUG}"
exec "${abs_top_builddir}/libtool" --mode=execute $HAZE_WRAPPER \
    "${abs_top_builddir}/src/telepathy-haze"