Home | History | Annotate | Line # | Download | only in unit-tests
      1  1.2  rillig # $NetBSD: shell-ksh.mk,v 1.2 2025/06/05 21:56:54 rillig Exp $
      2  1.1  rillig #
      3  1.2  rillig # Tests for using a Korn shell for running the commands.
      4  1.1  rillig 
      5  1.2  rillig KSH!=	which ksh 2> /dev/null || true
      6  1.2  rillig 
      7  1.2  rillig # The shell path must be an absolute path.
      8  1.2  rillig # This is only obvious in parallel mode since in compat mode,
      9  1.2  rillig # simple commands are executed via execvp directly.
     10  1.2  rillig .if ${KSH} != ""
     11  1.2  rillig .SHELL: name="ksh" path="${KSH}"
     12  1.2  rillig .endif
     13  1.2  rillig 
     14  1.2  rillig # In parallel mode, the shell->noPrint command is filtered from
     15  1.2  rillig # the output, rather naively (in PrintOutput).
     16  1.2  rillig .MAKEFLAGS: -j1
     17  1.1  rillig 
     18  1.1  rillig all:
     19  1.2  rillig .if ${KSH} != ""
     20  1.2  rillig 	# This command is both printed and executed.
     21  1.2  rillig 	echo normal
     22  1.2  rillig 
     23  1.2  rillig 	# This command is only executed.
     24  1.2  rillig 	@echo hidden
     25  1.2  rillig 
     26  1.2  rillig 	# This command is both printed and executed.
     27  1.2  rillig 	+echo always
     28  1.2  rillig 
     29  1.2  rillig 	# This command is both printed and executed.
     30  1.2  rillig 	-echo ignore errors
     31  1.2  rillig 
     32  1.2  rillig 	# In the Korn shell, "set +v" is set as the noPrint command.
     33  1.2  rillig 	# Therefore, it is filtered from the output, rather naively.
     34  1.2  rillig # FIXME: Don't assume a newline character in PrintFilteredOutput.
     35  1.2  rillig # expect: The "is filtered out.
     36  1.2  rillig 	@echo 'The "set +v" is filtered out.'
     37  1.2  rillig .else
     38  1.2  rillig 	@sed '$$d' ${MAKEFILE:.mk=.exp}	# This is cheated.
     39  1.2  rillig .endif
     40