Source-Changes-HG archive

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

[src/netbsd-2-0]: src/usr.bin/make/unit-tests Pull up revision 1.3 (requested...



details:   https://anonhg.NetBSD.org/src/rev/ad0b78e82934
branches:  netbsd-2-0
changeset: 560843:ad0b78e82934
user:      tron <tron%NetBSD.org@localhost>
date:      Mon May 10 15:32:00 2004 +0000

description:
Pull up revision 1.3 (requested by sjg in ticket #282):
Allow "string" and "${varspec}" on lhs of conditionals.
This makes it possible to use expressions like
${("${LIST:Msomething"}):?present:absent}
it also makes treatment of lhs and rhs more consistent, and
makes CondToken easier to read.
Update unit-test/cond1 to test new features.

diffstat:

 usr.bin/make/unit-tests/cond1 |  34 +++++++++++++++++++++++++++++++---
 1 files changed, 31 insertions(+), 3 deletions(-)

diffs (52 lines):

diff -r a44a85d2afb3 -r ad0b78e82934 usr.bin/make/unit-tests/cond1
--- a/usr.bin/make/unit-tests/cond1     Mon May 10 15:27:41 2004 +0000
+++ b/usr.bin/make/unit-tests/cond1     Mon May 10 15:32:00 2004 +0000
@@ -1,10 +1,30 @@
-# $Id: cond1,v 1.3.2.3 2004/05/10 15:27:28 tron Exp $
+# $Id: cond1,v 1.3.2.4 2004/05/10 15:32:00 tron Exp $
+
+# hard code these!
+TEST_UNAME_S= NetBSD
+TEST_UNAME_M= sparc
+TEST_MACHINE= i386
 
-
+.if ${TEST_UNAME_S}
+Ok=var,
+.endif
+.if ("${TEST_UNAME_S}")
+Ok+=(\"var\"),
+.endif
+.if (${TEST_UNAME_M} != ${TEST_MACHINE})
+Ok+=(var != var),
+.endif
+.if ${TEST_UNAME_M} != ${TEST_MACHINE}
+Ok+= var != var,
+.endif
+.if !((${TEST_UNAME_M} != ${TEST_MACHINE}) && defined(X))
+Ok+= !((var != var) && defined(name)),
+.endif
 # from bsd.obj.mk
 MKOBJ?=no
 .if ${MKOBJ} == "no"
 o= no
+Ok+= var == "quoted",
 .else
 .if defined(notMAKEOBJDIRPREFIX) || defined(norMAKEOBJDIR)
 .if defined(notMAKEOBJDIRPREFIX)
@@ -69,6 +89,14 @@
 B=unknown
 .endif
 
+.if "quoted" == quoted
+C=clever
+.else
+C=dim
+.endif
+
 all:
        @echo "$n is $X prime"
-       @echo "A='$A' B='$B' o='$o,${o2}'"
+       @echo "A='$A' B='$B' C='$C' o='$o,${o2}'"
+       @echo "Passed:${.newline} ${Ok:S/,/${.newline}/}"
+       @echo "${NUMBERS:@n@$n is ${("${PRIMES:M$n}" == ""):?not:} prime${.newline}@}"



Home | Main Index | Thread Index | Old Index