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): add test for braces in depe...



details:   https://anonhg.NetBSD.org/src/rev/0b97852f7cc6
branches:  trunk
changeset: 974417:0b97852f7cc6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jul 31 16:42:51 2020 +0000

description:
make(1): add test for braces in dependency lines

The comment at DirExpandCurly says something about "recursively", but the
nested braces don't work.

The manual page only mentions that "{} may be used", but it keeps quiet
about the exact meaning and also doesn't mention any nesting.

diffstat:

 distrib/sets/lists/tests/mi      |   4 +++-
 usr.bin/make/unit-tests/Makefile |   3 ++-
 usr.bin/make/unit-tests/dir.exp  |  11 +++++++++++
 usr.bin/make/unit-tests/dir.mk   |  33 +++++++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 2 deletions(-)

diffs (87 lines):

diff -r 7e8fe6b66024 -r 0b97852f7cc6 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Fri Jul 31 16:26:16 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Fri Jul 31 16:42:51 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.881 2020/07/28 22:44:44 rillig Exp $
+# $NetBSD: mi,v 1.882 2020/07/31 16:42:51 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4536,6 +4536,8 @@
 ./usr/tests/usr.bin/make/unit-tests/cond1.mk   tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond2.exp  tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond2.mk   tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/dir.exp    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/dir.mk     tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directives.exp     tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directives.mk      tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/dollar.exp tests-usr.bin-tests     compattestfile,atf
diff -r 7e8fe6b66024 -r 0b97852f7cc6 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Fri Jul 31 16:26:16 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Fri Jul 31 16:42:51 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.76 2020/07/29 19:48:33 rillig Exp $
+# $NetBSD: Makefile,v 1.77 2020/07/31 16:42:51 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -37,6 +37,7 @@
 TESTS+=                cond-short
 TESTS+=                cond1
 TESTS+=                cond2
+TESTS+=                dir
 TESTS+=                directives
 TESTS+=                dollar
 TESTS+=                doterror
diff -r 7e8fe6b66024 -r 0b97852f7cc6 usr.bin/make/unit-tests/dir.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/dir.exp   Fri Jul 31 16:42:51 2020 +0000
@@ -0,0 +1,11 @@
+make: Unterminated {} clause "thiteen"
+1
+2
+3
+4
+5
+make: don't know how to make fouteen (continuing)
+make: don't know how to make rteen (continuing)
+15
+`all' not remade because of errors.
+exit status 0
diff -r 7e8fe6b66024 -r 0b97852f7cc6 usr.bin/make/unit-tests/dir.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/dir.mk    Fri Jul 31 16:42:51 2020 +0000
@@ -0,0 +1,33 @@
+# $NetBSD: dir.mk,v 1.1 2020/07/31 16:42:51 rillig Exp $
+#
+# Tests for dir.c.
+
+# Dependency lines may use braces for expansion.
+all: {one,two,three}
+
+one:
+       @echo 1
+two:
+       @echo 2
+three:
+       @echo 3
+
+# The braces may start in the middle of a word.
+all: f{our,ive}
+
+four:
+       @echo 4
+five:
+       @echo 5
+six:
+       @echo 6
+
+# But nested braces don't work.
+all: {{thi,fou}r,fif}teen
+
+thirteen:
+       @echo 13
+fourteen:
+       @echo 14
+fifteen:
+       @echo 15



Home | Main Index | Thread Index | Old Index