mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-28 20:44:42 +08:00
1c0bbd6eee
Add --track-fds=yes.
31 lines
889 B
Bash
31 lines
889 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,'
|
|
# To restore:
|
|
# find tests -name Makefile.am|xargs grep -wl PATH|xargs perl -pi -e 's,src/vg,src,'
|
|
#
|
|
# Create this symlink for suppressions (this is no longer necessary,
|
|
# with linux-2.6.9 and valgrind-2.2.0):
|
|
# 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 --logfile-fd=3 --leak-check=yes --track-fds=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
|