Home | History | Annotate | Line # | Download | only in unit-tests
job-output.mk revision 1.2.4.2
      1  1.2.4.2  perseant # $NetBSD: job-output.mk,v 1.2.4.2 2025/08/02 05:58:35 perseant Exp $
      2  1.2.4.2  perseant #
      3  1.2.4.2  perseant # Tests for handling the output in parallel mode.
      4  1.2.4.2  perseant 
      5  1.2.4.2  perseant all: .PHONY
      6  1.2.4.2  perseant 	@${MAKE} -f ${MAKEFILE} -j1 empty-lines
      7  1.2.4.2  perseant 	@${MAKE} -f ${MAKEFILE} -j1 stdout-and-stderr
      8  1.2.4.2  perseant 	@${MAKE} -f ${MAKEFILE} -j1 echo-on-stdout-and-stderr
      9  1.2.4.2  perseant 
     10  1.2.4.2  perseant # By sleeping for a second, the output of the child process is written byte
     11  1.2.4.2  perseant # by byte, to be consumed in small pieces by make.  No matter what the chunk
     12  1.2.4.2  perseant # size is, the empty lines must not be discarded.
     13  1.2.4.2  perseant empty-lines: .PHONY
     14  1.2.4.2  perseant 	@echo begin $@
     15  1.2.4.2  perseant 	@sleep 1
     16  1.2.4.2  perseant 	@echo
     17  1.2.4.2  perseant 	@sleep 1
     18  1.2.4.2  perseant 	@echo
     19  1.2.4.2  perseant 	@sleep 1
     20  1.2.4.2  perseant 	@echo end $@
     21  1.2.4.2  perseant 
     22  1.2.4.2  perseant # In parallel mode, both stdout and stderr from the child process are
     23  1.2.4.2  perseant # collected in a local buffer and then written to make's stdout.
     24  1.2.4.2  perseant #
     25  1.2.4.2  perseant # expect: begin stdout-and-stderr
     26  1.2.4.2  perseant # expect: only stdout:
     27  1.2.4.2  perseant # expect: This is stdout.
     28  1.2.4.2  perseant # expect: This is stderr.
     29  1.2.4.2  perseant # expect: only stderr:
     30  1.2.4.2  perseant # expect: end stdout-and-stderr
     31  1.2.4.2  perseant stdout-and-stderr:
     32  1.2.4.2  perseant 	@echo begin $@
     33  1.2.4.2  perseant 	@echo only stdout:
     34  1.2.4.2  perseant 	@${MAKE} -f ${MAKEFILE} echo-on-stdout-and-stderr 2>/dev/null
     35  1.2.4.2  perseant 	@echo only stderr:
     36  1.2.4.2  perseant 	@${MAKE} -f ${MAKEFILE} echo-on-stdout-and-stderr 1>/dev/null
     37  1.2.4.2  perseant 	@echo end $@
     38  1.2.4.2  perseant 
     39  1.2.4.2  perseant echo-on-stdout-and-stderr: .PHONY
     40  1.2.4.2  perseant 	@echo This is stdout.
     41  1.2.4.2  perseant 	@echo This is stderr. 1>&2
     42