File: run-test.sh.in

package info (click to toggle)
dovecot 1%3A2.4.1%2Bdfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 46,224 kB
  • sloc: ansic: 596,204; makefile: 7,825; sh: 6,005; cpp: 1,866; perl: 487; yacc: 412; lex: 320; python: 253; xml: 232
file content (54 lines) | stat: -rw-r--r-- 1,205 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
#!/bin/sh

## serial 2

set -eu

top_srcdir="@abs_top_srcdir@"
VALGRIND="@VALGRIND@"

if test $# -eq 0 || test "$1" = ""; then
  echo "Missing target binary" >&2
  exit 1
fi

if test "${NOUNDEF:-}" != ""; then
  noundef="--undef-value-errors=no"
else
  noundef=""
fi

if test "${NOCHILDREN:-}" != ""; then
  trace_children="--trace-children=no"
else
  trace_children="--trace-children=yes"
fi

skip_path="$top_srcdir/run-test-valgrind.exclude"
if test -r "$skip_path" && grep -w -q "$(basename $[1])" "$skip_path"; then
  NOVALGRIND=true
fi

if test "${NOVALGRIND:-}" != ""; then
  "$@"
  ret=$?
else
  test_out="test.out~$$"
  trap "rm -f $test_out" 0 1 2 3 15
  supp_path="$top_srcdir/run-test-valgrind.supp"
  ret=0
  if test -r "$supp_path"; then
    $VALGRIND -q $trace_children --error-exitcode=213 --leak-check=full --gen-suppressions=all --suppressions="$supp_path" --log-file=$test_out $noundef "$@" || ret=$?
  else
    $VALGRIND -q $trace_children --error-exitcode=213 --leak-check=full --gen-suppressions=all --log-file=$test_out $noundef "$@" || ret=$?
  fi
  if test -s $test_out; then
    cat $test_out
    ret=1
  fi
fi
if test $ret != 0; then
  echo "Failed to run: $@" >&2
fi

exit $ret