Home | History | Annotate | Line # | Download | only in unit-tests
      1 # $NetBSD: opt-debug-errors-jobs.mk,v 1.2 2021/11/27 23:56:11 rillig Exp $
      2 #
      3 # Tests for the -de command line option, which adds debug logging for
      4 # failed commands and targets; since 2021-04-27 also in jobs mode.
      5 
      6 .MAKEFLAGS: -de -j1
      7 
      8 all: fail-spaces
      9 all: fail-escaped-space
     10 all: fail-newline
     11 all: fail-multiline
     12 all: fail-multiline-intention
     13 all: fail-vars
     14 
     15 fail-spaces:
     16 	echo '3   spaces'; false
     17 
     18 fail-escaped-space:
     19 	echo \  indented; false
     20 
     21 fail-newline:
     22 	echo 'line1${.newline}line2'; false
     23 
     24 # The line continuations in multiline commands are turned into an ordinary
     25 # space before the command is actually run.
     26 fail-multiline:
     27 	echo 'line1\
     28 		line2'; false
     29 
     30 # It is a common style to align the continuation backslashes at the right
     31 # of the lines, usually at column 73.  All spaces before the continuation
     32 # backslash are preserved and are usually outside a shell word and thus
     33 # irrelevant.  Since "usually" is not "always", these space characters are
     34 # not merged into a single space.
     35 fail-multiline-intention:
     36 	echo	'word1'							\
     37 		'word2'; false
     38 
     39 # In makefiles that rely heavily on abstracted variables, it is not possible
     40 # to determine the actual command from the unexpanded command alone. To help
     41 # debugging these issues (for example in NetBSD's build.sh), output the
     42 # expanded command as well whenever it differs from the unexpanded command.
     43 # Since 2021-11-28.
     44 COMPILE_C=	false c-compiler
     45 COMPILE_C_DEFS=	macro="several words"
     46 COMPILE_C_FLAGS=flag1 ${COMPILE_C_DEFS:@def@-${def}@}
     47 fail-vars:
     48 	@${COMPILE_C} ${COMPILE_C_FLAGS}
     49