diff options
| author | rillig <rillig@NetBSD.org> | 2020-09-06 04:35:03 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2020-09-06 04:35:03 +0000 |
| commit | 8c0bee61ebe7de46302ae8fac2b0c9987116fe16 (patch) | |
| tree | bc17714b54678f449ad0b1573f336716029efeaa /usr.bin/make/unit-tests/opt-debug-errors.mk | |
| parent | a3244cc423ce5b649d0da6b64c880cfed0708c68 (diff) | |
make(1): add test for the -de option
Diffstat (limited to 'usr.bin/make/unit-tests/opt-debug-errors.mk')
| -rw-r--r-- | usr.bin/make/unit-tests/opt-debug-errors.mk | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/usr.bin/make/unit-tests/opt-debug-errors.mk b/usr.bin/make/unit-tests/opt-debug-errors.mk index 6e5cb88bec3..1658c6b3ce3 100644 --- a/usr.bin/make/unit-tests/opt-debug-errors.mk +++ b/usr.bin/make/unit-tests/opt-debug-errors.mk @@ -1,9 +1,42 @@ -# $NetBSD: opt-debug-errors.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# $NetBSD: opt-debug-errors.mk,v 1.2 2020/09/06 04:35:03 rillig Exp $ # # Tests for the -de command line option, which adds debug logging for # failed commands and targets. -# TODO: Implementation +.MAKEFLAGS: -de -all: - @:; +all: fail-spaces +all: fail-escaped-space +all: fail-newline +all: fail-multiline +all: fail-multiline-intention + +# XXX: The debug output folds the spaces, showing '3 spaces' instead of +# the correct '3 spaces'. +fail-spaces: + echo '3 spaces'; false + +# XXX: The debug output folds the spaces, showing 'echo \ indented' instead +# of the correct 'echo \ indented'. +fail-escaped-space: + echo \ indented; false + +# XXX: A newline is turned into an ordinary space in the debug log. +fail-newline: + echo 'line1${.newline}line2'; false + +# The line continuations in multiline commands are turned into an ordinary +# space before the command is actually run. +fail-multiline: + echo 'line1\ + line2'; false + +# It is a common style to align the continuation backslashes at the right +# of the lines, usually at column 73. All spaces before the continuation +# backslash are preserved and are usually outside a shell word and thus +# irrelevant. Having these spaces collapsed makes sense to show the command +# in its condensed form. +# +fail-multiline-intention: + echo 'word1' \ + 'word2'; false |
