coreutils/README-valgrind
Jim Meyering 3b5a75ec1d .
2003-11-17 16:13:56 +00:00

28 lines
739 B
Bash

#! /bin/bash
# Convert Makefile.am files:
# find tests -name Makefile.am | xargs grep -wl PATH|xargs perl -pi -e \
# 's,src(\$\(PATH_SEPARATOR\)\$\$PATH),src/vg$1,'
#
# Create this symlink for suppressions:
# ln -s $PWD/.vg-suppressions /tmp/cu-vg
# Create src/vg:
coreutils=$(echo 'spy:;@echo $(all_programs)' | (cd src; make -f Makefile -f - spy | tr -s '\n ' ' '))
mkdir -p src/vg
pwd=`pwd`
srcdir=$pwd/src
path='export PATH='$srcdir':${PATH#*:}'
pre='#!/bin/sh\n'"$path"'\n'
n=9
vg='exec /usr/bin/valgrind --suppressions=/tmp/cu-vg --gen-suppressions=yes --leak-check=yes --quiet --num-callers='$n
cat <<EOF > src/vg/gen
for i in $coreutils; do
printf "$pre$vg \$i"' "\$@"\n' > \$i
chmod a+x \$i
done
EOF
cd src/vg
. ./gen