*** empty log message ***
[coreutils.git] / README-valgrind
blobe080d246b4c35a8aa246917d585037b7fbd77e9d
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 (this is no longer necessary,
10 # with linux-2.6.9 and valgrind-2.2.0):
11 # ln -s $PWD/.vg-suppressions /tmp/cu-vg
13 # Create src/vg:
15 coreutils=$(echo 'spy:;@echo $(all_programs)' | (cd src; make -f Makefile -f - spy | tr -s '\n ' ' '))
16 mkdir -p src/vg
17 pwd=`pwd`
18 srcdir=$pwd/src
19 path='export PATH='$srcdir':${PATH#*:}'
20 pre='#!/bin/sh\n'"$path"'\n'
21 n=9
22 vg='exec /usr/bin/valgrind --logfile-fd=3 --leak-check=yes --track-fds=yes --quiet --num-callers='$n
23 cat <<EOF > src/vg/gen
24 for i in $coreutils; do
25 printf "$pre$vg \$i"' "\$@"\n' > \$i
26 chmod a+x \$i
27 done
28 EOF
29 cd src/vg
30 . ./gen