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 make(1): move test result of var-op-...



details:   https://anonhg.NetBSD.org/src/rev/d871ad231dea
branches:  trunk
changeset: 1017436:d871ad231dea
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 27 21:31:27 2020 +0000

description:
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.

diffstat:

 usr.bin/make/unit-tests/var-op-expand.exp |   9 ---------
 usr.bin/make/unit-tests/var-op-expand.mk  |  17 ++++++++++++-----
 2 files changed, 12 insertions(+), 14 deletions(-)

diffs (45 lines):

diff -r a909f8a4bbd4 -r d871ad231dea usr.bin/make/unit-tests/var-op-expand.exp
--- a/usr.bin/make/unit-tests/var-op-expand.exp Sun Dec 27 21:25:02 2020 +0000
+++ b/usr.bin/make/unit-tests/var-op-expand.exp Sun Dec 27 21:31:27 2020 +0000
@@ -1,10 +1,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
diff -r a909f8a4bbd4 -r d871ad231dea usr.bin/make/unit-tests/var-op-expand.mk
--- a/usr.bin/make/unit-tests/var-op-expand.mk  Sun Dec 27 21:25:02 2020 +0000
+++ b/usr.bin/make/unit-tests/var-op-expand.mk  Sun Dec 27 21:31:27 2020 +0000
@@ -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 @@
 # 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:
        @:;



Home | Main Index | Thread Index | Old Index