1 # $NetBSD: opt-keep-going-indirect.mk,v 1.2 2022/02/12 20:05:36 rillig Exp $
3 # Tests for the -k command line option, which stops building a target as soon
4 # as an error is detected, but continues building the other, independent
5 # targets, as far as possible.
8 # In 1993, the exit status for the option '-k' was always 0, even if a
9 # direct or an indirect target failed.
11 # Since 2000.12.30.02.05.21, the word '(continuing)' is missing in jobs
12 # mode, both for direct as well as indirect targets.
14 # Since 2001.10.16.18.50.12, the exit status for a direct failure in
15 # compat mode is the correct 1, while jobs mode and indirect failures
16 # still return the wrong exit status 0. The number of empty lines
17 # between the various error messages differs between the modes, for no
20 # At 2006.11.17.22.07.39, the exit status for direct failures in both
21 # modes and for indirect failures in jobs mode was fixed to the correct
22 # 1. The exit status for indirect failures in compat mode is still the
23 # wrong 0. On the downside, a failed indirect target in jobs mode is no
24 # longer listed as "not remade because of errors".
26 # At 2016.08.26.23.28.39, the additional empty line for a direct failure
27 # in compat mode was removed, making it consistent with a direct failure
28 # in jobs mode. This left only one inconsistency, in that indirect
29 # failures in jobs mode (by far the most common when building large
30 # projects) did not produce any empty line.
32 # Since 2020.12.07.00.53.30, the exit status is consistently 1 for
33 # failures in all 4 modes.
36 # The output in case of a failure needlessly differs between compat and
37 # jobs mode. As of 2022-02-12, compat mode outputs '(continuing)' while
38 # jobs mode doesn't. In compat mode, the output does not mention which
42 # https://gnats.netbsd.org/49720
44 .PHONY: all direct indirect
46 # The 'set +e' was necessary in 2003, when the shell was run with '-e' by
48 # The 'env -i' prevents that the environment variable MAKEFLAGS is passed down
49 # to the child processes.
52 @set +e; env -i ${MAKE} -r -f ${MAKEFILE} -k direct; echo "exited $$?"
56 @set +e; env -i ${MAKE} -r -f ${MAKEFILE} -k direct -j1; echo "exited $$?"
59 @echo 'indirect compat'
60 @set +e; env -i ${MAKE} -r -f ${MAKEFILE} -k indirect; echo "exited $$?"
64 @set +e; env -i ${MAKE} -r -f ${MAKEFILE} -k indirect -j1; echo "exited $$?"
71 # TODO: Mention the target that failed, maybe even the chain of targets.
72 # expect: direct compat
73 # expect: *** Error code 1 (continuing)
76 # TODO: Add '(continuing)'.
78 # expect: *** [direct] Error code 1
81 # TODO: Mention the target that failed, maybe even the chain of targets.
82 # expect: indirect compat
83 # expect: *** Error code 1 (continuing)
86 # TODO: Add '(continuing)'.
87 # TODO: Add 'not remade because of errors'.
88 # expect: indirect jobs
89 # expect: *** [direct] Error code 1