]> git.proxmox.com Git - mirror_ovs.git/blame - tests/valgrind-wrapper.in
ofp-print: Abbreviate lists of fields in table features output.
[mirror_ovs.git] / tests / valgrind-wrapper.in
CommitLineData
b6fa4447
BP
1#! /bin/sh
2
3wrap_program=`basename '@wrap_program@'`
4
5# Strip the first directory from $PATH that contains $wrap_program,
6# so that below we run the real $wrap_program, not ourselves.
7not_found=true
8new_path=
9first=true
10save_IFS=$IFS
11IFS=:
12for dir in $PATH; do
13 IFS=$save_IFS
14 if $not_found && test -x "$dir/$wrap_program"; then
15 not_found=false
16 else
17 if $first; then
18 first=false
19 new_path=$dir
20 else
21 new_path=$new_path:$dir
22 fi
23 fi
24done
25IFS=$save_IFS
26if $not_found; then
27 echo "$0: error: cannot find $wrap_program in \$PATH" >&2
28 exit 1
29fi
30PATH=$new_path
31export PATH
32
33: ${VALGRIND:=valgrind -q --log-file=valgrind.%p --leak-check=full}
34exec $VALGRIND $wrap_program "$@"
35echo "$0: failed to execute $VALGRIND $wrap_program" "$@" >&2
36exit 1