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