*** empty log message ***
[coreutils.git] / README-valgrind
blob903bf3b11a485e9ebb38df63081155ed35728932
1 #! /bin/bash
3 # Convert Makefile.am files:
4 # find tests -name Makefile.am | xargs grep -wl PATH|xargs perl -pi -e \
5 # 's,src(\$\(PATH_SEPARATOR\)\$\$PATH),src/vg$1,'
6 # To restore:
7 # find tests -name Makefile.am|xargs grep -wl PATH|xargs perl -pi -e 's,src/vg,src,'
9 # Create this symlink for suppressions:
10 # ln -s $PWD/.vg-suppressions /tmp/cu-vg
12 # Create src/vg:
14 coreutils=$(echo 'spy:;@echo $(all_programs)' | (cd src; make -f Makefile -f - spy | tr -s '\n ' ' '))
15 mkdir -p src/vg
16 pwd=`pwd`
17 srcdir=$pwd/src
18 path='export PATH='$srcdir':${PATH#*:}'
19 pre='#!/bin/sh\n'"$path"'\n'
20 n=9
21 vg='exec /usr/bin/valgrind --suppressions=/tmp/cu-vg --gen-suppressions=yes --leak-check=yes --quiet --num-callers='$n
22 cat <<EOF > src/vg/gen
23 for i in $coreutils; do
24 printf "$pre$vg \$i"' "\$@"\n' > \$i
25 chmod a+x \$i
26 done
27 EOF
28 cd src/vg
29 . ./gen