2002-12-01 00:34:20 +08:00
|
|
|
#! /bin/bash
|
2002-12-01 00:17:29 +08:00
|
|
|
|
2002-12-01 00:34:20 +08:00
|
|
|
# Convert Makefile.am files:
|
2003-07-27 18:01:55 +08:00
|
|
|
# find tests -name Makefile.am | xargs grep -wl PATH|xargs perl -pi -e \
|
|
|
|
# 's,src(\$\(PATH_SEPARATOR\)\$\$PATH),src/vg$1,'
|
2004-03-23 04:40:03 +08:00
|
|
|
# To restore:
|
|
|
|
# find tests -name Makefile.am|xargs grep -wl PATH|xargs perl -pi -e 's,src/vg,src,'
|
2003-11-17 21:46:34 +08:00
|
|
|
#
|
|
|
|
# Create this symlink for suppressions:
|
|
|
|
# ln -s $PWD/.vg-suppressions /tmp/cu-vg
|
|
|
|
|
2002-12-01 00:34:20 +08:00
|
|
|
# Create src/vg:
|
|
|
|
|
2002-12-01 01:13:33 +08:00
|
|
|
coreutils=$(echo 'spy:;@echo $(all_programs)' | (cd src; make -f Makefile -f - spy | tr -s '\n ' ' '))
|
2003-07-27 18:02:16 +08:00
|
|
|
mkdir -p src/vg
|
2002-12-01 00:17:29 +08:00
|
|
|
pwd=`pwd`
|
2003-07-27 18:01:55 +08:00
|
|
|
srcdir=$pwd/src
|
|
|
|
path='export PATH='$srcdir':${PATH#*:}'
|
2002-12-01 00:17:29 +08:00
|
|
|
pre='#!/bin/sh\n'"$path"'\n'
|
2002-12-01 01:13:33 +08:00
|
|
|
n=9
|
2003-11-18 00:13:56 +08:00
|
|
|
vg='exec /usr/bin/valgrind --suppressions=/tmp/cu-vg --gen-suppressions=yes --leak-check=yes --quiet --num-callers='$n
|
2002-12-01 01:13:33 +08:00
|
|
|
cat <<EOF > src/vg/gen
|
2002-12-01 00:34:20 +08:00
|
|
|
for i in $coreutils; do
|
2002-12-01 01:13:33 +08:00
|
|
|
printf "$pre$vg \$i"' "\$@"\n' > \$i
|
|
|
|
chmod a+x \$i
|
2002-12-01 00:17:29 +08:00
|
|
|
done
|
|
|
|
EOF
|
|
|
|
cd src/vg
|
2002-12-01 01:13:33 +08:00
|
|
|
. ./gen
|