summaryrefslogtreecommitdiff
path: root/tests/twisted/tools/exec-with-log.sh.in
blob: 9ff5a8994dba17d6f9fd8d672690b9e52297da35 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh

# Copyright (C) 2009 Nokia Corporation
# Copyright (C) 2009 Collabora Ltd.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA

cd "@abs_top_builddir@/tests/twisted/tools"

G_MESSAGES_DEBUG=all
export G_MESSAGES_DEBUG
ulimit -c unlimited
exec > missioncontrol-$$.log 2>&1
ln -f missioncontrol-$$.log missioncontrol.log

if test -z "$MC_ACCOUNT_DIR"; then
        echo "MC_ACCOUNT_DIR must be set"
        exit 1
fi

if test -n "$MISSIONCONTROL_TEST_VALGRIND"; then
        G_DEBUG="$G_DEBUG,gc-friendly"
        export G_DEBUG
        G_SLICE=always-malloc
        export G_SLICE
	MISSIONCONTROL_WRAPPER="valgrind --leak-check=full --num-callers=20"
	MISSIONCONTROL_WRAPPER="$MISSIONCONTROL_WRAPPER --track-origins=yes"
	MISSIONCONTROL_WRAPPER="$MISSIONCONTROL_WRAPPER -v"
	MISSIONCONTROL_WRAPPER="$MISSIONCONTROL_WRAPPER --suppressions=@abs_top_srcdir@/tests/twisted/tools/valgrind.supp"
	MISSIONCONTROL_WRAPPER="$MISSIONCONTROL_WRAPPER --gen-suppressions=all"
	MISSIONCONTROL_WRAPPER="$MISSIONCONTROL_WRAPPER --show-reachable=yes"
elif test -n "$MISSIONCONTROL_TEST_REFDBG"; then
        if test -z "$REFDBG_OPTIONS" ; then
                REFDBG_OPTIONS="btnum=10"
                export REFDBG_OPTIONS
        fi
        if test -z "$MISSIONCONTROL_WRAPPER" ; then
                MISSIONCONTROL_WRAPPER="refdbg"
        fi
fi

# The bus-daemon that is activating us doesn't know it's also the system bus
DBUS_SYSTEM_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS"
export DBUS_SYSTEM_BUS_ADDRESS

if test "z$MC_EXECUTABLE" = z; then
        MC_EXECUTABLE=@abs_top_builddir@/tests/twisted/mc-debug-server
fi

if test -f "$MC_ACCOUNT_DIR/gnome-keyring-env"; then
        cat "$MC_ACCOUNT_DIR/gnome-keyring-env"
        . "$MC_ACCOUNT_DIR/gnome-keyring-env"
        export GNOME_KEYRING_CONTROL GNOME_KEYRING_PID MC_KEYRING_NAME SSH_AUTH_SOCK
fi

GSETTINGS_SCHEMA_DIR=@abs_top_builddir@/data
export GSETTINGS_SCHEMA_DIR

exec @abs_top_builddir@/libtool --mode=execute \
        $MISSIONCONTROL_WRAPPER \
        $MC_EXECUTABLE