summaryrefslogtreecommitdiff
path: root/unit-tests/cond-func.mk
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2020-11-07 19:39:21 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2020-11-07 19:39:21 +0000
commit302da1a3d35c15cb29d76e0a939f8bcb13f7ad80 (patch)
treec2146dca82d530521c4d2cc46a95c26964311a2c /unit-tests/cond-func.mk
parent6bbc783f48498b808e19db4441299dc7d85a278b (diff)
downloadsrc-test2-302da1a3d35c15cb29d76e0a939f8bcb13f7ad80.tar.gz
src-test2-302da1a3d35c15cb29d76e0a939f8bcb13f7ad80.zip
Import bmake-20201101vendor/NetBSD/bmake/20201101
Lots of new unit-tests increase code coverage. Lots of refactoring, cleanup and simlpification to reduce code size. Fixes for Bug 223564 and 245807 Updates to dirdeps.mk and meta2deps.py
Notes
Notes: svn path=/vendor/NetBSD/bmake/dist/; revision=367460 svn path=/vendor/NetBSD/bmake/20201101/; revision=367461; tag=vendor/NetBSD/bmake/20201101
Diffstat (limited to 'unit-tests/cond-func.mk')
-rw-r--r--unit-tests/cond-func.mk32
1 files changed, 20 insertions, 12 deletions
diff --git a/unit-tests/cond-func.mk b/unit-tests/cond-func.mk
index 304735241e7f..8e7362182429 100644
--- a/unit-tests/cond-func.mk
+++ b/unit-tests/cond-func.mk
@@ -1,4 +1,4 @@
-# $NetBSD: cond-func.mk,v 1.1 2020/08/20 17:45:47 rillig Exp $
+# $NetBSD: cond-func.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $
#
# Tests for those parts of the functions in .if conditions that are common
# among several functions.
@@ -12,27 +12,27 @@ ${:UVAR(value)}= variable name with parentheses
${:UVAR{value}}= variable name with braces
.if !defined(DEF)
-.error
+. error
.endif
-# Horizontal whitespace after the opening parenthesis is ignored.
+# Horizontal whitespace (space tab) after the opening parenthesis is ignored.
.if !defined( DEF)
-.error
+. error
.endif
-# Horizontal whitespace before the closing parenthesis is ignored.
+# Horizontal whitespace (space tab) before the closing parenthesis is ignored.
.if !defined(DEF )
-.error
+. error
.endif
# The argument of a function must not directly contain whitespace.
.if !defined(A B)
-.error
+. error
.endif
# If necessary, the whitespace can be generated by a variable expression.
.if !defined(${:UA B})
-.error
+. error
.endif
# Characters that could be mistaken for operators must not appear directly
@@ -42,21 +42,29 @@ ${:UVAR{value}}= variable name with braces
# It's not entirely clear why these characters are forbidden.
# The most plausible reason seems to be typo detection.
.if !defined(A&B)
-.error
+. error
.endif
.if !defined(A|B)
-.error
+. error
.endif
# Even parentheses may appear in variable names.
# They must be balanced though.
.if !defined(VAR(value))
-.error
+. error
.endif
# Braces do not have any special meaning when parsing arguments.
.if !defined(VAR{value})
-.error
+. error
+.endif
+
+# There may be spaces around the operators and parentheses, and even
+# inside the parentheses. The spaces inside the parentheses are not
+# allowed for the empty() function (see cond-func-empty.mk), therefore
+# they are typically omitted for the other functions as well.
+.if ! defined ( DEF )
+. error
.endif
all: