File: run.sh

package info (click to toggle)
gxr 0.15.1-2~bpo10+1
  • links: PTS, VCS
  • area: main
  • in suites: buster-backports
  • size: 1,728 kB
  • sloc: ansic: 15,256; sh: 72; xml: 71; awk: 35; makefile: 12
file content (85 lines) | stat: -rwxr-xr-x 2,182 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/sh

export G_SLICE=always-malloc
export G_DEBUG=gc-friendly

SUPP_DIR=valgrind/suppressions

BIN_NAME=$(basename $1)

generate_suppressions()
{
  valgrind \
    -v \
    --tool=memcheck \
    --leak-check=full \
    --show-leak-kinds=all \
    --num-callers=20 \
    --show-reachable=yes \
    --error-limit=no \
    --track-origins=yes \
    --suppressions=$SUPP_DIR/external/GNOME.supp/base.supp \
    --suppressions=$SUPP_DIR/external/GNOME.supp/gdk.supp \
    --suppressions=$SUPP_DIR/external/GNOME.supp/glib.supp \
    --suppressions=$SUPP_DIR/external/GNOME.supp/gtk3.supp \
    --suppressions=$SUPP_DIR/external/GNOME.supp/gio.supp \
    --suppressions=$SUPP_DIR/external/GNOME.supp/gobject.supp \
    --suppressions=$SUPP_DIR/external/glib.supp \
    --suppressions=$SUPP_DIR/mesa.supp \
    --suppressions=$SUPP_DIR/glib.supp \
    --suppressions=$SUPP_DIR/misc.supp \
    --suppressions=$SUPP_DIR/openvr.supp \
    --log-file=memcheck.log \
    --gen-suppressions=all \
    $1

  cat ./memcheck.log | valgrind/parse_suppressions.sh > $SUPP_DIR/$BIN_NAME.supp
}

show_memleaks()
{
  valgrind \
    -v \
    --tool=memcheck \
    --leak-check=full \
    --show-leak-kinds=all \
    --leak-resolution=high \
    --num-callers=20 \
    --show-reachable=yes \
    --error-limit=no \
    --track-origins=yes \
    --suppressions=$SUPP_DIR/external/GNOME.supp/base.supp \
    --suppressions=$SUPP_DIR/external/GNOME.supp/gdk.supp \
    --suppressions=$SUPP_DIR/external/GNOME.supp/glib.supp \
    --suppressions=$SUPP_DIR/external/GNOME.supp/gtk3.supp \
    --suppressions=$SUPP_DIR/external/GNOME.supp/gio.supp \
    --suppressions=$SUPP_DIR/external/GNOME.supp/gobject.supp \
    --suppressions=$SUPP_DIR/external/glib.supp \
    --suppressions=$SUPP_DIR/mesa.supp \
    --suppressions=$SUPP_DIR/glib.supp \
    --suppressions=$SUPP_DIR/misc.supp \
    --suppressions=$SUPP_DIR/openvr.supp \
    $1
}

if [ -z ${1+x} ]; then
  echo "Usage: $0 <test_name>"
  exit 1;
fi

if [ -z ${2+x} ]; then
  show_memleaks $1
else
  case $2 in
      -g)
      generate_suppressions $1
      ;;
      *)    # unknown option
      echo "Unknown argument $2"
      ;;
  esac
fi