3 abs_top_builddir='@abs_top_builddir@'
4 wrap_program=`basename '@wrap_program@'`
6 # Strip the first directory from $PATH that contains $wrap_program,
7 # so that below we run the real $wrap_program, not ourselves.
15 if $not_found && test -x "$dir/$wrap_program"; then
22 new_path=$new_path:$dir
28 echo "$0: error: cannot find $wrap_program in \$PATH" >&2
34 if test "$DISABLE_LCOV" = true; then
35 exec $wrap_program "$@"
39 # XXX Probably want some kind of synchronization here to deal with
40 # programs running in parallel.
41 LCOV="lcov -b $abs_top_builddir -d $abs_top_builddir -q"
44 # Run the subprocess and propagate signals to it.
45 for signal in 1 2 3 5 15; do
46 trap "kill -$signal \$! # Propagate signal
47 trap - $signal # Reset signal to default
48 wait # Wait for child to die
49 kill -$signal $$ # Kill ourselves with same signal
50 exit 1 # Exit in case 'kill' failed" $signal
52 $wrap_program 0<&0 "$@" & # 0<&0 prevents shell from closing stdin
53 exec 0</dev/null # Don't hold stdin open unnecessarily
56 # Run lcov, but only if some .gcda files were produced, since lcov
57 # complains otherwise.
58 for file in `find "$abs_top_builddir" -name '*.gcda'`; do
59 $LCOV -c -o - >> "$abs_top_builddir/tests/coverage.info"