Module Name: src Committed By: sjg Date: Tue Jan 24 00:20:00 UTC 2023
Added Files: src/usr.bin/make/unit-tests: var-readonly.exp var-readonly.mk Log Message: Add the unit tests To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/var-readonly.exp \ src/usr.bin/make/unit-tests/var-readonly.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Added files: Index: src/usr.bin/make/unit-tests/var-readonly.exp diff -u /dev/null src/usr.bin/make/unit-tests/var-readonly.exp:1.1 --- /dev/null Tue Jan 24 00:20:00 2023 +++ src/usr.bin/make/unit-tests/var-readonly.exp Tue Jan 24 00:20:00 2023 @@ -0,0 +1 @@ +exit status 0 Index: src/usr.bin/make/unit-tests/var-readonly.mk diff -u /dev/null src/usr.bin/make/unit-tests/var-readonly.mk:1.1 --- /dev/null Tue Jan 24 00:20:00 2023 +++ src/usr.bin/make/unit-tests/var-readonly.mk Tue Jan 24 00:20:00 2023 @@ -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: +