Edit

kc3-lang/automake/tests/vars3.test

Branch :

  • Show log

    Commit

  • Author : Stefano Lattarini
    Date : 2010-06-11 21:22:40
    Hash : f2d7321b
    Message : Testsuite: ensure verbose printing of captured stderr. * tests/acloca18.test: Print captured stderr before either failing or grepping it. Be sure to send captured stderr to stderr, not to stdout. * tests/ansi3b.test: Likewise. * tests/cond39.test: Likewise. * tests/configure.test: Likewise. * tests/missing3.test: Likewise. * tests/missing6.test: Likewise. * tests/output-order.test: Likewise. * tests/pr300-ltlib.test: Likewise. * tests/python6.test: Likewise. * tests/python7.test: Likewise. * tests/python8.test: Likewise. * tests/python9.test: Likewise. * tests/subobj.test: Likewise. * tests/vars3.test: Likewise. * tests/missing4.test: Likewise, and fix a call to grep not to use the `-c' flag. * tests/ansi3.test: Likewise, and rely on the `configure.in' stub created by `./defs', rather than writing one from scratch. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

  • tests/vars3.test
  • #! /bin/sh
    # Copyright (C) 2002, 2010 Free Software Foundation, Inc.
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 2, or (at your option)
    # any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    # Check that Automake warns about variables containing spaces
    # and other non-POSIX characters.
    
    . ./defs || Exit 1
    
    set -e
    
    cat >Makefile.am <<'EOF'
    L01 = $(shell echo *)
    L02 = $$(not an error)
    L03 = $$(this is)$${ok too}
    L04 = $(nextvariableisbad)$(addsuffix .a, $(A))
    L05 = "$(bad boy)"
    L06 = $(this:is= ok)
    L07 = ${three errors}${on this} $(long line)
    L08$(o u c h): $(wildcard *.c)
    	${another error}
    	echo $${ok-this is}
    L11: $(thisis) $(ok)
    	${here}
    EOF
    
    $ACLOCAL
    # Make sure this warning is print in the `portability' category.
    $AUTOMAKE --warnings=no-error,none,portability 2>stderr \
      || { cat stderr >&2; Exit 1; }
    cat stderr >&2
    
    # Lines number are printed in error message.
    # Use them to make sure errors are diagnosed against the right lines.
    
    # No error expected for these lines.
    grep 1: stderr
    grep 2: stderr && Exit 1
    grep 3: stderr && Exit 1
    grep 4: stderr
    grep 5: stderr
    grep 6: stderr && Exit 1
    grep 7: stderr
    grep 8: stderr
    grep 9: stderr
    grep 10: stderr && Exit 1
    grep 11: stderr && Exit 1
    grep 12: stderr && Exit 1
    
    # Now check some individual values.
    grep 'shell echo' stderr
    grep 'nextvariableisbad' stderr && Exit 1
    grep 'addsuffix' stderr
    grep 'bad boy' stderr
    grep 'ok' stderr && Exit 1
    grep 'three errors' stderr
    grep 'on this' stderr
    grep 'long line' stderr
    grep 'o u c h' stderr
    grep 'wildcard' stderr
    grep 'another error' stderr
    grep 'thisis' stderr && Exit 1
    grep 'here' stderr && Exit 1
    
    # None of these errors be diagnosed with -Wno-portability
    $AUTOMAKE -Wno-portability
    
    # Likewise if we add this in the Makefile.am
    # (although this makes some difference internally: AUTOMAKE_OPTIONS is
    # processed far later).
    echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
    $AUTOMAKE