aboutsummaryrefslogtreecommitdiff
path: root/unit-tests
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2026-07-05 18:22:31 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2026-07-05 18:22:31 +0000
commite988c5eab5231646c612d35ff5b16122cebfbf6a (patch)
tree307239878c1f97050623742f4663c68476e81e4f /unit-tests
parentef402bba84260816d3e8d6e2439b0bc7eddc9446 (diff)
Intersting/relevant changes since bmake-20260508 ChangeLog since bmake-20260508 2026-07-04 Simon J Gerraty <sjg@beast.crufty.net> * VERSION (_MAKE_VERSION): 20260704 2026-07-03 Simon J Gerraty <sjg@beast.crufty.net> * VERSION (_MAKE_VERSION): 20260703 Merge with NetBSD make, pick up o meta.c: do a better job of resolving relative paths o var.c: add alternation support to :M eg. :M*{Makefile*,.mk} matches any *Makefile* or *.mk 2026-07-02 Simon J Gerraty <sjg@beast.crufty.net> * VERSION (_MAKE_VERSION): 20260702 Merge with NetBSD make, pick up o meta.c: .MAKE.META.FILTER can be used to more generally filter relevant content of .meta file in meta_oodate. 2026-06-19 Simon J Gerraty <sjg@beast.crufty.net> * VERSION (_MAKE_VERSION): 20260619 Merge with NetBSD make, pick up o make.1: fix description of .MADE it is a source not a target. * update mk files 2026-06-10 Simon J Gerraty <sjg@beast.crufty.net> * VERSION (_MAKE_VERSION): 20260609 Merge with NetBSD make, pick up o parse.c: allow semicolons and parentheses in dependency line expressions mk/ChangeLog since bmake-20260508 2026-07-04 Simon J Gerraty <sjg@beast.crufty.net> * install-mk (MK_VERSION): 20260704 2026-07-03 Simon J Gerraty <sjg@beast.crufty.net> * dirdeps.mk: make use of alternation support in latest bmake when setting .MAKE.META.IGNORE_FILTER so we can get both Makefile.depend* and *.mk to make cache out-of-date. 2026-07-02 Simon J Gerraty <sjg@beast.crufty.net> * meta2deps.py: detect corrupted filemon data on Linux, caused by lost newlines. 2026-06-21 Simon J Gerraty <sjg@beast.crufty.net> * install-mk (MK_VERSION): 20260621 * gendirdeps.mk: more debug output * meta.autodep.mk: remove extra } from GENDIRDEPS_ENV 2026-06-19 Simon J Gerraty <sjg@beast.crufty.net> * install-mk (MK_VERSION): 20260619 * install-new.mk: for POSIX_SHELL we need .new* rather than just .new 2026-05-21 Simon J Gerraty <sjg@beast.crufty.net> * meta2deps.{py,sh}: skip pathnames with spaces - not worth the pain.
Diffstat (limited to 'unit-tests')
-rw-r--r--unit-tests/dep.exp20
-rw-r--r--unit-tests/dep.mk54
-rw-r--r--unit-tests/dir.mk4
-rw-r--r--unit-tests/varmod-match.mk12
4 files changed, 75 insertions, 15 deletions
diff --git a/unit-tests/dep.exp b/unit-tests/dep.exp
index c08f86bc73db..99295ee12b4f 100644
--- a/unit-tests/dep.exp
+++ b/unit-tests/dep.exp
@@ -1,5 +1,17 @@
-make: dep.mk:11: Inconsistent operator for only-colon
-make: dep.mk:13: Inconsistent operator for only-colon
+make: dep.mk:18: Inconsistent operator for only-colon
+ in make[1] in directory "<curdir>"
+make: dep.mk:20: Inconsistent operator for only-colon
+ in make[1] in directory "<curdir>"
make: Fatal errors encountered -- cannot continue
-make: stopped making "all" in unit-tests
-exit status 1
+make: stopped making "parse-only-colon" in unit-tests
+sub exit status 1
+Making renamed-parse-semicolon-in-source out of nothing.
+Making parse-semicolon-in-source from renamed-parse-semicolon-in-source.
+make: Malformed expression at "$$-rest"
+ in make[1] in directory "<curdir>"
+semicolon-in-modifier.param: after semicolon
+parentheses-in-modifier.1-12-23-3: after semicolon
+var-semicolon.: after semicolon
+double-dollar.$-rest: after semicolon
+sub exit status 2
+exit status 0
diff --git a/unit-tests/dep.mk b/unit-tests/dep.mk
index 53fadc789b13..259085e27b1d 100644
--- a/unit-tests/dep.mk
+++ b/unit-tests/dep.mk
@@ -1,8 +1,15 @@
-# $NetBSD: dep.mk,v 1.4 2023/06/01 07:27:30 rillig Exp $
+# $NetBSD: dep.mk,v 1.6 2026/06/09 08:27:08 rillig Exp $
#
# Tests for dependency declarations, such as "target: sources".
-.MAIN: all
+all: .PHONY
+ @${MAKE} -f ${MAKEFILE} parse-only-colon || echo "sub exit status $$?"
+ @${MAKE} -f ${MAKEFILE} parse-semicolon-in-source
+ @${MAKE} -f ${MAKEFILE} parse-semicolon || echo "sub exit status $$?"
+
+
+.if make(parse-only-colon)
+parse-only-colon: .PHONY
# As soon as a target is defined using one of the dependency operators, it is
# restricted to this dependency operator and cannot use the others anymore.
@@ -15,16 +22,47 @@ only-colon::
# would be another error message.
only-colon:
+.endif
+
# Before parse.c 1.158 from 2009-10-07, the parser broke dependency lines at
# the first ';', without parsing expressions as such. It interpreted the
# first ';' as the separator between the dependency and its commands, and the
# '^' as a shell command.
-all: for-subst
-.for file in ${.PARSEFILE}
-for-subst: ${file:S;^;./;g}
- @echo ".for with :S;... OK"
-.endfor
+.if make(parse-semicolon-in-source)
+parse-semicolon-in-source: .PHONY
+
+. for file in parse-semicolon-in-source
+parse-semicolon-in-source: ${file:S;^;renamed-;g}
+ @echo "Making ${.TARGET} from ${.ALLSRC}."
+renamed-parse-semicolon-in-source:
+ @echo "Making ${.TARGET} out of nothing."
+. endfor
+
+.endif
+
+
+# Before parse.c 1.757 from 2026-06-09, the parser counted "$(" and "${" as
+# opening a brace level, and ")" and "}" as closing it. It didn't count a
+# plain "(" or "{" as opening, though. This simple counting resulted in
+# parse errors on modifiers containing parentheses or braces, as well as
+# semicolons.
+.if make(parse-semicolon)
+parse-semicolon: .PHONY
+
+semicolon-in-modifier.${:Utarget:S;target;param;}:; @echo '$@: after semicolon'
+parse-semicolon: semicolon-in-modifier.param
+
+parentheses-in-modifier.${:U123:C;(.);\1-\1;g}:; @echo '$@: after semicolon'
+parse-semicolon: parentheses-in-modifier.1-12-23-3
+
+var-semicolon.$;:; @echo '$@: after semicolon'
+parse-semicolon: var-semicolon.
+# Using actual dollars in target names is still tricky and not recommended,
+# due to multiple levels of expansion, that's where the 8 dollars come from.
+# expect: make: Malformed expression at "$$-rest"
+double-dollar.$$$;-$$$$-rest:; @echo '$@: after semicolon'
+parse-semicolon: double-dollar.$$$$-$$$$$$$$-rest
-all:
+.endif
diff --git a/unit-tests/dir.mk b/unit-tests/dir.mk
index 956285393489..685a4660f01c 100644
--- a/unit-tests/dir.mk
+++ b/unit-tests/dir.mk
@@ -1,4 +1,4 @@
-# $NetBSD: dir.mk,v 1.11 2023/12/19 19:33:40 rillig Exp $
+# $NetBSD: dir.mk,v 1.12 2026/07/03 15:31:35 sjg Exp $
#
# Tests for dir.c.
@@ -21,7 +21,7 @@ all: {one,two,three}
.if target({one,two,three})
. error
.endif
-.if ${.ALLTARGETS:M{one,two,three}} != "{one,two,three}"
+.if ${.ALLTARGETS:M\{one,two,three\}} != "{one,two,three}"
. error
.endif
diff --git a/unit-tests/varmod-match.mk b/unit-tests/varmod-match.mk
index 5894196c9cd5..0e5664bb3870 100644
--- a/unit-tests/varmod-match.mk
+++ b/unit-tests/varmod-match.mk
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-match.mk,v 1.32 2025/06/29 09:40:13 rillig Exp $
+# $NetBSD: varmod-match.mk,v 1.33 2026/07/03 15:31:35 sjg Exp $
#
# Tests for the ':M' modifier, which keeps only those words that match the
# given pattern.
@@ -388,3 +388,13 @@ WORDS= [x- x x- y yyyyy
.if ${:U:${:UM\\\:\\}}
. error
.endif
+
+# :M supports alternation
+.if ${/bin/sh ../Makefile.inc cat .../mk/sys.mk:L:M*{Makefile*,.mk}} != "../Makefile.inc .../mk/sys.mk"
+. error
+.endif
+
+# :M supports alternation
+.if ${{a} one and two {o} yes:L:M\{{a,e,i,o,u}\}} != "{a} {o}"
+. error
+.endif