Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests Add the unit tests



details:   https://anonhg.NetBSD.org/src/rev/5c9bdb4e1215
branches:  trunk
changeset: 373208:5c9bdb4e1215
user:      sjg <sjg%NetBSD.org@localhost>
date:      Tue Jan 24 00:20:00 2023 +0000

description:
Add the unit tests

diffstat:

 usr.bin/make/unit-tests/var-readonly.exp |   1 +
 usr.bin/make/unit-tests/var-readonly.mk  |  20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diffs (29 lines):

diff -r b1230831c800 -r 5c9bdb4e1215 usr.bin/make/unit-tests/var-readonly.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/var-readonly.exp  Tue Jan 24 00:20:00 2023 +0000
@@ -0,0 +1,1 @@
+exit status 0
diff -r b1230831c800 -r 5c9bdb4e1215 usr.bin/make/unit-tests/var-readonly.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/var-readonly.mk   Tue Jan 24 00:20:00 2023 +0000
@@ -0,0 +1,20 @@
+# $NetBSD: var-readonly.mk,v 1.1 2023/01/24 00:20:00 sjg Exp $
+
+# the answer
+N = 42
+.READONLY: N
+# this should be ignored
+N = 666
+.if ${N} != 42
+.error N ($N) should be 42
+.endif
+
+.NOREADONLY: N
+# now we can change it
+N = 69
+.if ${N} == 42
+.error N should not be 42
+.endif
+
+all:
+



Home | Main Index | Thread Index | Old Index