Home | History | Annotate | Line # | Download | only in unit-tests
opt-jobs-internal.mk revision 1.3.4.1
      1  1.3.4.1  perseant # $NetBSD: opt-jobs-internal.mk,v 1.3.4.1 2025/08/02 05:58:36 perseant Exp $
      2      1.1    rillig #
      3  1.3.4.1  perseant # Tests for the (intentionally undocumented) internal -J command line option.
      4  1.3.4.1  perseant 
      5  1.3.4.1  perseant all: .PHONY
      6  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} -j1 direct
      7  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} -j1 direct-syntax
      8  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} -j1 direct-open
      9  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} -j1 indirect-open
     10  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} -j1 indirect-expr
     11  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} -j1 indirect-comment
     12  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} -j1 indirect-silent-comment
     13  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} -j1 indirect-expr-empty
     14  1.3.4.1  perseant 
     15  1.3.4.1  perseant detect-mode: .PHONY
     16  1.3.4.1  perseant 	@mode=parallel
     17  1.3.4.1  perseant 	@echo ${HEADING}: mode=$${mode:-compat}
     18  1.3.4.1  perseant 
     19  1.3.4.1  perseant # expect: direct: mode=parallel
     20  1.3.4.1  perseant direct: .PHONY
     21  1.3.4.1  perseant 	@mode=parallel
     22  1.3.4.1  perseant 	@echo ${.TARGET}: mode=$${mode:-compat}
     23  1.3.4.1  perseant 
     24  1.3.4.1  perseant # expect: make: error: invalid internal option "-J garbage" in "<curdir>"
     25  1.3.4.1  perseant direct-syntax: .PHONY
     26  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} -J garbage unexpected-target || :
     27  1.3.4.1  perseant 
     28  1.3.4.1  perseant # expect: direct-open: mode=compat
     29  1.3.4.1  perseant direct-open: .PHONY
     30  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} -J 31,32 detect-mode HEADING=${.TARGET}
     31  1.3.4.1  perseant 
     32  1.3.4.1  perseant # expect: indirect-open: mode=compat
     33  1.3.4.1  perseant indirect-open: .PHONY
     34  1.3.4.1  perseant 	@${MAKE:U} -f ${MAKEFILE} detect-mode HEADING=${.TARGET}
     35  1.3.4.1  perseant 
     36  1.3.4.1  perseant # When a command in its unexpanded form contains the expression "${MAKE}"
     37  1.3.4.1  perseant # without any modifiers, the file descriptors get passed around.
     38  1.3.4.1  perseant # expect: indirect-expr: mode=parallel
     39  1.3.4.1  perseant indirect-expr: .PHONY
     40  1.3.4.1  perseant 	@${MAKE} -f ${MAKEFILE} detect-mode HEADING=${.TARGET}
     41  1.3.4.1  perseant 
     42  1.3.4.1  perseant # The "# make" comment starts directly after the leading tab and is thus not
     43  1.3.4.1  perseant # considered a shell command line. No file descriptors are passed around.
     44  1.3.4.1  perseant # expect: indirect-comment: mode=compat
     45  1.3.4.1  perseant indirect-comment: .PHONY
     46  1.3.4.1  perseant 	# make
     47  1.3.4.1  perseant 	@${MAKE:U} -f ${MAKEFILE} detect-mode HEADING=${.TARGET}
     48  1.3.4.1  perseant 
     49  1.3.4.1  perseant # When the "# make" comment is prefixed with "@", it becomes a shell command.
     50  1.3.4.1  perseant # As that shell command contains the plain word "make", the file descriptors
     51  1.3.4.1  perseant # get passed around.
     52  1.3.4.1  perseant # expect: indirect-silent-comment: mode=parallel
     53  1.3.4.1  perseant indirect-silent-comment: .PHONY
     54  1.3.4.1  perseant 	@# make
     55  1.3.4.1  perseant 	@${MAKE:U} -f ${MAKEFILE} detect-mode HEADING=${.TARGET}
     56      1.1    rillig 
     57  1.3.4.1  perseant # When a command in its unexpanded form contains the plain word "make", the
     58  1.3.4.1  perseant # file descriptors get passed around.
     59  1.3.4.1  perseant # expect: indirect-expr-empty: mode=parallel
     60  1.3.4.1  perseant indirect-expr-empty: .PHONY
     61  1.3.4.1  perseant 	@${:D make}
     62  1.3.4.1  perseant 	@${MAKE:U} -f ${MAKEFILE} detect-mode HEADING=${.TARGET}
     63