File: run-test.sh

package info (click to toggle)
cutter-testing-framework 1.1.7-1.2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 18,556 kB
  • sloc: ansic: 79,864; xml: 38,680; sh: 10,266; makefile: 2,324; ruby: 845; cpp: 697
file content (95 lines) | stat: -rwxr-xr-x 2,671 bytes parent folder | download
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/sh

BASE_DIR="`dirname $0`"
export BASE_DIR
top_dir="$BASE_DIR/.."

if test x"$RUNNING_TEST" = x"yes"; then
    exit 0
fi

if test x"$NO_MAKE" != x"yes"; then
    if test -z "$MAKE"; then
	if which gmake 2>&1 > /dev/null; then
	    MAKE=gmake
	else
	    MAKE=make
	fi
    fi
    RUNNING_TEST=yes
    export RUNNING_TEST
    $MAKE -C $top_dir/ check INTLTOOL_UPDATE=: > /dev/null || exit 1
fi

if test -z "$CUTTER"; then
    CUTTER="$BASE_DIR/`make -s -C $BASE_DIR echo-cutter`"
fi

CUTTER_ARGS=
CUTTER_WRAPPER=
if test x"$CUTTER_DEBUG" = x"yes"; then
    CUTTER_WRAPPER="$top_dir/libtool --mode=execute gdb --args"
    CUTTER_ARGS="--keep-opening-modules"
elif test x"$CUTTER_CHECK_LEAK" = x"yes"; then
    CUTTER_WRAPPER="$top_dir/libtool --mode=execute valgrind "
    CUTTER_WRAPPER="$CUTTER_WRAPPER --leak-check=full --show-reachable=yes -v"
    CUTTER_ARGS="--keep-opening-modules"
fi

CUT_ICONS_DIR=$(cd $top_dir/data/icons; pwd)
CUT_UI_MODULE_DIR=$top_dir/module/ui/.libs
CUT_UI_FACTORY_MODULE_DIR=$top_dir/module/ui/.libs
CUT_REPORT_MODULE_DIR=$top_dir/module/report/.libs
CUT_REPORT_FACTORY_MODULE_DIR=$top_dir/module/report/.libs
CUT_STREAM_MODULE_DIR=$top_dir/module/stream/.libs
CUT_STREAM_FACTORY_MODULE_DIR=$top_dir/module/stream/.libs

export CUTTER
export CUT_ICONS_DIR
export CUT_UI_MODULE_DIR
export CUT_UI_FACTORY_MODULE_DIR
export CUT_REPORT_MODULE_DIR
export CUT_REPORT_FACTORY_MODULE_DIR
export CUT_STREAM_MODULE_DIR
export CUT_STREAM_FACTORY_MODULE_DIR

CUTTER_ARGS="$CUTTER_ARGS -s $BASE_DIR --exclude-directory fixtures"
CUTTER_ARGS="$CUTTER_ARGS --exclude-directory lib"
if echo "$@" | grep -- --mode=analyze > /dev/null; then
    :
else
    CUTTER_ARGS="$CUTTER_ARGS --stream=xml --stream-directory $top_dir/log"
fi
if test x"$USE_GTK" = x"yes"; then
    CUTTER_ARGS="-u gtk $CUTTER_ARGS"
fi

case `uname` in
    CYGWIN*)
	PATH="$top_dir/cutter/.libs:$PATH"
	PATH="$top_dir/gcutter/.libs:$PATH"
	PATH="$top_dir/cppcutter/.libs:$PATH"
	PATH="$top_dir/gdkcutter-pixbuf/.libs:$PATH"
	PATH="$top_dir/soupcutter/.libs:$PATH"
	PATH="$top_dir/test/lib/.libs:$PATH"
	;;
    Darwin)
	DYLD_LIBRARY_PATH="$top_dir/cppcutter/.libs:$DYLD_LIBRARY_PATH"
	DYLD_LIBRARY_PATH="$top_dir/gdkcutter-pixbuf/.libs:$DYLD_LIBRARY_PATH"
	DYLD_LIBRARY_PATH="$top_dir/soupcutter/.libs:$DYLD_LIBRARY_PATH"
	export DYLD_LIBRARY_PATH
	;;
    *BSD)
	LD_LIBRARY_PATH="$top_dir/cppcutter/.libs:$LD_LIBRARY_PATH"
	LD_LIBRARY_PATH="$top_dir/gdkcutter-pixbuf/.libs:$LD_LIBRARY_PATH"
	LD_LIBRARY_PATH="$top_dir/soupcutter/.libs:$LD_LIBRARY_PATH"
	export LD_LIBRARY_PATH
        ;;
    *)
	:
	;;
esac

LC_ALL=C
export LC_ALL
$CUTTER_WRAPPER $CUTTER $CUTTER_ARGS "$@" $BASE_DIR