2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Test the example of usage of generic and extension-specific
18 # LOG_COMPILER and LOG_FLAGS given in the manual.
24 cat >> configure.ac <<END
25 AC_SUBST([PERL], ['$PERL'])
30 cat > Makefile.am << 'END'
31 TESTS = foo.pl bar.py baz
32 TEST_EXTENSIONS = .pl .py
33 PL_LOG_COMPILER = $(PERL)
35 PY_LOG_COMPILER = $(PYTHON)
37 LOG_COMPILER = ./wrapper-script
41 echo 'my $a =+ 2; exit (0);' > foo.pl
42 echo 'import sys; sys.exit(0);' > bar.py
45 cat > wrapper-script <<'END'
47 echo "wrapper args: $*"
49 chmod a+x wrapper-script
62 test $st -eq 0 || Exit $st
64 # Check that the wrappers have been run with the expected flags.
65 grep '[rR]eversed.*+=.*operator.*foo\.pl' foo.log
66 grep '^# *[cC]lear.*sys\.argv' bar.log
67 grep '^wrapper args:.* -d .*baz' baz.log