xref: /freebsd/contrib/bmake/unit-tests/directive-info.mk (revision ba3c1f5972d7b90feb6e6da47905ff2757e0fe57)
1# $NetBSD: directive-info.mk,v 1.11 2023/06/01 20:56:35 rillig Exp $
2#
3# Tests for the .info directive.
4#
5# Until parse.c 1.502 from 2020-12-19, a missing argument to the directive
6# produced the wrong error message "Unknown directive".  Since parse.c 1.503
7# from 2020-12-19, the correct "Missing argument" is produced.
8
9# TODO: Implementation
10
11# expect+1: begin .info tests
12.info begin .info tests
13# expect+1: Unknown directive "inf"
14.inf				# misspelled
15# expect+1: Missing argument for ".info"
16.info
17# expect+1: message
18.info message
19# expect+1: indented message
20.info		indented message
21# expect+1: Unknown directive "information"
22.information
23# expect+1: Unknown directive "information"
24.information message		# Accepted before 2020-12-13 01:07:54.
25.info.man:			# not a message, but possibly a suffix rule
26
27# Even if lines would have trailing whitespace, this would be trimmed by
28# ParseRawLine.
29# expect+1: Missing argument for ".info"
30.info
31# expect+1: Missing argument for ".info"
32.info				# comment
33
34.info: message			# This is a dependency declaration.
35# expect+1: Unknown directive "info-message"
36.info-message			# This is an unknown directive.
37# expect+1: no-target: no-source
38.info no-target: no-source	# This is a .info directive, not a dependency.
39# See directive.mk for more tests of this kind.
40
41# Since at least 2002-01-01 and before parse.c 1.639 from 2022-01-08, the line
42# number that is used in error messages and the .info directives was the
43# number of completely read lines.  For the following multi-line directive,
44# this meant that the reported line number was the one of the last line, not
45# of the first line.
46# expect+1: expect line 35 for multi-line message
47.info expect line 35 for\
48	multi$\
49	-line message
50