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 # XXX Probably want some kind of synchronization here to deal with
35 # programs running in parallel.
36 LCOV="lcov -b $abs_top_builddir -d $abs_top_builddir -q"
39 # Run the subprocess and propagate signals to it.
40 for signal in 1 2 3 5 15; do
41 trap "kill -$signal \$! # Propagate signal
42 trap - $signal # Reset signal to default
43 wait # Wait for child to die
44 kill -$signal $$ # Kill ourselves with same signal
45 exit 1 # Exit in case 'kill' failed" $signal
47 $wrap_program 0<&0 "$@" & # 0<&0 prevents shell from closing stdin
48 exec 0</dev/null # Don't hold stdin open unnecessarily
51 # Run lcov, but only if some .gcda files were produced, since lcov
52 # complains otherwise.
53 for file in `find "$abs_top_builddir" -name '*.gcda'`; do
54 $LCOV -c -o - >> "$abs_top_builddir/tests/coverage.info"