Home | History | Annotate | Line # | Download | only in unit-tests
opt-debug-jobs.mk revision 1.6
      1  1.6  rillig # $NetBSD: opt-debug-jobs.mk,v 1.6 2023/11/19 21:47:52 rillig Exp $
      2  1.1  rillig #
      3  1.4  rillig # Tests for the -dj command line option, which adds debug logging about
      4  1.1  rillig # running jobs in multiple shells.
      5  1.1  rillig 
      6  1.4  rillig .MAKEFLAGS: -dj
      7  1.4  rillig 
      8  1.4  rillig # Run in parallel mode since the debug logging is more interesting there
      9  1.4  rillig # than in compat mode.
     10  1.4  rillig .MAKEFLAGS: -j1
     11  1.1  rillig 
     12  1.1  rillig all:
     13  1.4  rillig 	# Only the actual command is logged.
     14  1.6  rillig 	# To see the evaluation of the expressions, use -dv.
     15  1.4  rillig 	: ${:Uexpanded} expression
     16  1.4  rillig 
     17  1.4  rillig 	# Undefined variables expand to empty strings.
     18  1.4  rillig 	# Multiple spaces are preserved in the command, as they might be
     19  1.4  rillig 	# significant.
     20  1.4  rillig 	: ${UNDEF} variable
     21  1.4  rillig 
     22  1.4  rillig 	# In the debug output, single quotes are not escaped, even though
     23  1.4  rillig 	# the whole command is enclosed in single quotes as well.
     24  1.4  rillig 	# This allows to copy and paste the whole command, without having
     25  1.4  rillig 	# to unescape anything.
     26  1.4  rillig 	: 'single' and "double" quotes
     27  1.5  rillig 
     28  1.5  rillig 	# Avoid a race condition in the debug output.  Without sleeping,
     29  1.5  rillig 	# it is not guaranteed that the two lines "exited/stopped" and
     30  1.5  rillig 	# "JobFinish" are output earlier than the stdout of the actual shell
     31  1.5  rillig 	# commands.  The '@' prefix avoids that this final command gets into
     32  1.5  rillig 	# another race condition with the "exited/stopped" line.
     33  1.5  rillig 	@sleep 1
     34