]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/opt-debug-errors.mk
Update to bmake-20201101
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / opt-debug-errors.mk
1 # $NetBSD: opt-debug-errors.mk,v 1.2 2020/09/06 04:35:03 rillig Exp $
2 #
3 # Tests for the -de command line option, which adds debug logging for
4 # failed commands and targets.
5
6 .MAKEFLAGS: -de
7
8 all: fail-spaces
9 all: fail-escaped-space
10 all: fail-newline
11 all: fail-multiline
12 all: fail-multiline-intention
13
14 # XXX: The debug output folds the spaces, showing '3 spaces' instead of
15 # the correct '3   spaces'.
16 fail-spaces:
17         echo '3   spaces'; false
18
19 # XXX: The debug output folds the spaces, showing 'echo \ indented' instead
20 # of the correct 'echo \  indented'.
21 fail-escaped-space:
22         echo \  indented; false
23
24 # XXX: A newline is turned into an ordinary space in the debug log.
25 fail-newline:
26         echo 'line1${.newline}line2'; false
27
28 # The line continuations in multiline commands are turned into an ordinary
29 # space before the command is actually run.
30 fail-multiline:
31         echo 'line1\
32                 line2'; false
33
34 # It is a common style to align the continuation backslashes at the right
35 # of the lines, usually at column 73.  All spaces before the continuation
36 # backslash are preserved and are usually outside a shell word and thus
37 # irrelevant.  Having these spaces collapsed makes sense to show the command
38 # in its condensed form.
39 #
40 fail-multiline-intention:
41         echo    'word1'                                                 \
42                 'word2'; false