Module Name:    src
Committed By:   rillig
Date:           Sun Dec 27 21:31:28 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: var-op-expand.exp var-op-expand.mk

Log Message:
make(1): move test result of var-op-expand.mk from exp to mk

This makes it easier to run this test in older versions of make.  Empty
output means success.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/var-op-expand.exp
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/var-op-expand.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/var-op-expand.exp
diff -u src/usr.bin/make/unit-tests/var-op-expand.exp:1.2 src/usr.bin/make/unit-tests/var-op-expand.exp:1.3
--- src/usr.bin/make/unit-tests/var-op-expand.exp:1.2	Sun Nov  8 13:46:15 2020
+++ src/usr.bin/make/unit-tests/var-op-expand.exp	Sun Dec 27 21:31:27 2020
@@ -1,10 +1 @@
-Var_Parse: ${UNDEF} with VARE_WANTRES
-Global:VAR_ASSIGN_ = undef value
-Var_Parse: ${UNDEF} with VARE_WANTRES
-Var_Parse: ${UNDEF} with VARE_WANTRES
-Global:VAR_SUBST_${UNDEF} = 
-Var_Parse: ${UNDEF} with VARE_WANTRES
-Global:VAR_SUBST_ = undef value
-Global:.MAKEFLAGS =  -r -k -d v -d
-Global:.MAKEFLAGS =  -r -k -d v -d 0
 exit status 0

Index: src/usr.bin/make/unit-tests/var-op-expand.mk
diff -u src/usr.bin/make/unit-tests/var-op-expand.mk:1.6 src/usr.bin/make/unit-tests/var-op-expand.mk:1.7
--- src/usr.bin/make/unit-tests/var-op-expand.mk:1.6	Sun Dec 27 21:19:13 2020
+++ src/usr.bin/make/unit-tests/var-op-expand.mk	Sun Dec 27 21:31:27 2020
@@ -1,4 +1,4 @@
-# $NetBSD: var-op-expand.mk,v 1.6 2020/12/27 21:19:13 rillig Exp $
+# $NetBSD: var-op-expand.mk,v 1.7 2020/12/27 21:31:27 rillig Exp $
 #
 # Tests for the := variable assignment operator, which expands its
 # right-hand side.
@@ -130,10 +130,17 @@ VAR:=		top:$$ ${:Unest1\:\$\$} ${:Unest2
 # to an empty string.  This way, 2 variables are created using a single
 # variable assignment.  It's magic. :-/
 .undef UNDEF
-.MAKEFLAGS: -dv
-VAR_ASSIGN_${UNDEF}=	undef value
-VAR_SUBST_${UNDEF}:=	undef value
-.MAKEFLAGS: -d0
+VAR_ASSIGN_${UNDEF}=	assigned by '='
+VAR_SUBST_${UNDEF}:=	assigned by ':='
+.if ${VAR_ASSIGN_} != "assigned by '='"
+.  error
+.endif
+.if ${${:UVAR_SUBST_\${UNDEF\}}} != ""
+.  error
+.endif
+.if ${VAR_SUBST_} != "assigned by ':='"
+.  error
+.endif
 
 all:
 	@:;

Reply via email to