aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/directive-ifmake.mk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/unit-tests/directive-ifmake.mk')
-rw-r--r--contrib/bmake/unit-tests/directive-ifmake.mk11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/bmake/unit-tests/directive-ifmake.mk b/contrib/bmake/unit-tests/directive-ifmake.mk
index a1ff3aef6825..fa0a56c60030 100644
--- a/contrib/bmake/unit-tests/directive-ifmake.mk
+++ b/contrib/bmake/unit-tests/directive-ifmake.mk
@@ -1,4 +1,4 @@
-# $NetBSD: directive-ifmake.mk,v 1.10 2022/02/09 21:09:24 rillig Exp $
+# $NetBSD: directive-ifmake.mk,v 1.12 2023/11/19 21:47:52 rillig Exp $
#
# Tests for the .ifmake directive, which provides a shortcut for asking
# whether a certain target is requested to be made from the command line.
@@ -10,6 +10,7 @@
# This is the most basic form.
.ifmake first
+# expect+1: ok: positive condition works
. info ok: positive condition works
.else
. warning positive condition fails
@@ -21,6 +22,7 @@
.ifmake !first
. warning unexpected
.else
+# expect+1: ok: negation works
. info ok: negation works
.endif
@@ -30,6 +32,7 @@
# exclamation mark were part of the name instead, the name would be '!!first',
# and such a target was not requested to be made.
.ifmake !!first
+# expect+1: ok: double negation works
. info ok: double negation works
.else
. warning double negation fails
@@ -37,6 +40,7 @@
# Multiple targets can be combined using the && and || operators.
.ifmake first && second
+# expect+1: ok: both mentioned
. info ok: both mentioned
.else
. warning && does not work as expected
@@ -44,6 +48,7 @@
# Negation also works in complex conditions.
.ifmake first && !unmentioned
+# expect+1: ok: only those mentioned
. info ok: only those mentioned
.else
. warning && with ! does not work as expected
@@ -54,6 +59,7 @@
# possible to extend the targets to be made.
.MAKEFLAGS: late-target
.ifmake late-target
+# expect+1: Targets can even be added at parse time.
. info Targets can even be added at parse time.
.else
. info No, targets cannot be added at parse time anymore.
@@ -69,9 +75,10 @@
. error
.endif
-# A condition that consists of a variable expression only (without any
+# A condition that consists of an expression only (without any
# comparison operator) can be used with .if and the other .ifxxx directives.
.ifmake ${:Ufirst}
+# expect+1: ok
. info ok
.else
. error