Home | History | Annotate | Line # | Download | only in unit-tests
      1  1.1  sjg #
      2  1.1  sjg 
      3  1.1  sjg .MAIN: all
      4  1.1  sjg 
      5  1.1  sjg .if make(output)
      6  1.1  sjg .MAKE.MODE= meta curDirOk=true nofilemon
      7  1.1  sjg .else
      8  1.1  sjg .MAKE.MODE= compat
      9  1.1  sjg .endif
     10  1.1  sjg 
     11  1.1  sjg all: output.-B output.-j1
     12  1.1  sjg 
     13  1.1  sjg _mf := ${.PARSEDIR}/${.PARSEFILE}
     14  1.1  sjg 
     15  1.5  sjg # This output should be accurately reflected in the .meta file.
     16  1.5  sjg # We append an extra newline to ${.TARGET} (after it has been
     17  1.5  sjg # written to stdout) to match what meta_cmd_finish() will do.
     18  1.1  sjg output: .NOPATH
     19  1.4  sjg 	@{ echo Test ${tag} output; \
     20  1.1  sjg 	for i in 1 2 3; do \
     21  1.4  sjg 	printf "test$$i:  "; sleep 0; echo " Done"; \
     22  1.5  sjg 	done; echo; } | tee ${.TARGET}; echo >> ${.TARGET}
     23  1.1  sjg 
     24  1.5  sjg # The diff at the end should produce nothing.
     25  1.1  sjg output.-B output.-j1:
     26  1.1  sjg 	@{ rm -f ${TMPDIR}/output; mkdir -p ${TMPDIR}/obj; \
     27  1.1  sjg 	MAKEFLAGS= ${.MAKE} -r -C ${TMPDIR} ${.TARGET:E} tag=${.TARGET:E} -f ${_mf} output; \
     28  1.5  sjg 	sed '1,/command output/d' ${TMPDIR}/obj/output.meta > ${TMPDIR}/obj/output-meta; \
     29  1.5  sjg 	diff -u ${TMPDIR}/obj/output ${TMPDIR}/obj/output-meta; }
     30  1.5  sjg 
     31