doc: typos in test file.
[automake.git] / t / comment5.sh
blob025ad5be066e81773f1b550ac35a209fd06cbe34
1 #! /bin/sh
2 # Copyright (C) 2002-2024 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # Test for PR/280.
18 # (Automake should complain about trailing backslashes in comments.)
20 . test-init.sh
22 cat >> configure.ac <<'EOF'
23 AC_OUTPUT
24 EOF
26 cat > Makefile.am << 'EOF'
27 all-local:
28 @echo ${var}
30 # a comment with backslash \
33 var = foo
34 EOF
36 $ACLOCAL
37 AUTOMAKE_fails
38 grep '^Makefile.am:5: error: blank line following trailing backslash' stderr
41 ## Here is a second test because head comments are
42 ## handled differently in Automake 1.5.
44 cat > Makefile.am << 'EOF'
45 # a comment with backslash \
48 all-local:
49 @echo ${var}
51 var = foo
52 EOF
54 AUTOMAKE_fails
55 grep '^Makefile.am:2: error: blank line following trailing backslash' stderr
58 ## Make sure we print an 'included' stack on errors.
60 echo 'include Makefile.inc'> Makefile.am
61 cat > Makefile.inc << 'EOF'
62 # a comment with backslash \
64 EOF
66 AUTOMAKE_fails
67 grep '^Makefile.inc:2: error: blank line following trailing backslash' stderr
68 grep '^Makefile.am:1: .*included from here' stderr
69 grep -v '^Makefile.am:1: .*error:' stderr
72 ## Make sure backslashes are still allowed within a comment.
73 ## This usually happens when commenting out a Makefile rule.
75 cat > Makefile.am << 'EOF'
76 all-local:
77 @echo ${var}
79 # a comment with backslash \
80 # but terminated by a line without backslash
82 var = foo
83 EOF
85 $AUTOMAKE