aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/var-readonly.mk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/unit-tests/var-readonly.mk')
-rw-r--r--contrib/bmake/unit-tests/var-readonly.mk27
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/bmake/unit-tests/var-readonly.mk b/contrib/bmake/unit-tests/var-readonly.mk
new file mode 100644
index 000000000000..e9ff6f38819f
--- /dev/null
+++ b/contrib/bmake/unit-tests/var-readonly.mk
@@ -0,0 +1,27 @@
+# $NetBSD: var-readonly.mk,v 1.4 2023/12/20 08:42:10 rillig Exp $
+
+# the answer
+N = 42
+.READONLY: N
+# this should be ignored
+N = 666
+.if ${N} != 42
+.error N ($N) should be 42
+.endif
+
+# undef should fail
+.MAKEFLAGS: -dv
+.undef N
+.ifndef N
+.error N should not be undef'd
+.endif
+.MAKEFLAGS: -d0
+
+.NOREADONLY: N
+# now we can change it
+N = 69
+.if ${N} == 42
+.error N should not be 42
+.endif
+
+all: