Module Name:    src
Committed By:   rillig
Date:           Sat Nov 21 10:32:42 UTC 2020

Modified Files:
        src/distrib/sets/lists/tests: mi
        src/usr.bin/make/unit-tests: Makefile
Added Files:
        src/usr.bin/make/unit-tests: suff-incomplete.exp suff-incomplete.mk

Log Message:
make(1): add test for incomplete transformation rule


To generate a diff of this commit:
cvs rdiff -u -r1.970 -r1.971 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.211 -r1.212 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/suff-incomplete.exp \
    src/usr.bin/make/unit-tests/suff-incomplete.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.970 src/distrib/sets/lists/tests/mi:1.971
--- src/distrib/sets/lists/tests/mi:1.970	Mon Nov 16 15:12:16 2020
+++ src/distrib/sets/lists/tests/mi	Sat Nov 21 10:32:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.970 2020/11/16 15:12:16 rillig Exp $
+# $NetBSD: mi,v 1.971 2020/11/21 10:32:42 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5279,6 +5279,8 @@
 ./usr/tests/usr.bin/make/unit-tests/suff-clear-regular.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-clear-single.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-clear-single.mk			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/suff-incomplete.exp				tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/suff-incomplete.mk				tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-lookup.exp				tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-lookup.mk				tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-main.exp				tests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.211 src/usr.bin/make/unit-tests/Makefile:1.212
--- src/usr.bin/make/unit-tests/Makefile:1.211	Thu Nov 19 23:50:26 2020
+++ src/usr.bin/make/unit-tests/Makefile	Sat Nov 21 10:32:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.211 2020/11/19 23:50:26 rillig Exp $
+# $NetBSD: Makefile,v 1.212 2020/11/21 10:32:42 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -263,6 +263,7 @@ TESTS+=		shell-sh
 TESTS+=		suff-add-later
 TESTS+=		suff-clear-regular
 TESTS+=		suff-clear-single
+TESTS+=		suff-incomplete
 TESTS+=		suff-lookup
 TESTS+=		suff-main
 TESTS+=		suff-rebuild

Added files:

Index: src/usr.bin/make/unit-tests/suff-incomplete.exp
diff -u /dev/null src/usr.bin/make/unit-tests/suff-incomplete.exp:1.1
--- /dev/null	Sat Nov 21 10:32:42 2020
+++ src/usr.bin/make/unit-tests/suff-incomplete.exp	Sat Nov 21 10:32:42 2020
@@ -0,0 +1,41 @@
+ParseReadLine (9): '.SUFFIXES:'
+ParseDoDependency(.SUFFIXES:)
+ParseReadLine (11): '.SUFFIXES: .a .b .c'
+ParseDoDependency(.SUFFIXES: .a .b .c)
+Adding suffix ".a"
+Adding suffix ".b"
+Adding suffix ".c"
+ParseReadLine (17): '.a.b:'
+ParseDoDependency(.a.b:)
+defining transformation from `.a' to `.b'
+inserting ".a" (1) at end of list
+inserting ".b" (2) at end of list
+ParseReadLine (21): '.a.c: ${.PREFIX}.dependency'
+deleting incomplete transformation from `.a' to `.b'
+ParseDoDependency(.a.c: ${.PREFIX}.dependency)
+defining transformation from `.a' to `.c'
+inserting ".a" (1) at end of list
+inserting ".c" (3) at end of list
+# LinkSource: added child .a.c - ${.PREFIX}.dependency
+# .a.c, made UNMADE, type OP_DEPENDS|OP_TRANSFORM, flags none
+# ${.PREFIX}.dependency, made UNMADE, type none, flags none
+ParseReadLine (23): '.DEFAULT:'
+transformation .a.c complete
+ParseDoDependency(.DEFAULT:)
+ParseReadLine (24): '	: Making ${.TARGET} from ${.IMPSRC} all ${.ALLSRC} by default.'
+transformation .DEFAULT complete
+Wildcard expanding "all"...
+SuffFindDeps (all)
+	No known suffix on all. Using .NULL suffix
+adding suffix rules
+Wildcard expanding "suff-incomplete.c"...suffix is ".c"...
+SuffFindDeps (suff-incomplete.c)
+	trying suff-incomplete.a...not there
+Wildcard expanding "suff-incomplete.c"...suffix is ".c"...
+: Making suff-incomplete.c from suff-incomplete.c all  by default.
+Wildcard expanding "all"...
+SuffFindDeps (.END)
+	No known suffix on .END. Using .NULL suffix
+adding suffix rules
+Wildcard expanding ".END"...
+exit status 0
Index: src/usr.bin/make/unit-tests/suff-incomplete.mk
diff -u /dev/null src/usr.bin/make/unit-tests/suff-incomplete.mk:1.1
--- /dev/null	Sat Nov 21 10:32:42 2020
+++ src/usr.bin/make/unit-tests/suff-incomplete.mk	Sat Nov 21 10:32:42 2020
@@ -0,0 +1,30 @@
+# $NetBSD: suff-incomplete.mk,v 1.1 2020/11/21 10:32:42 rillig Exp $
+#
+# Tests incomplete transformation rules, which are ignored.
+
+all: suff-incomplete.c
+
+.MAKEFLAGS: -dps
+
+.SUFFIXES:
+
+.SUFFIXES: .a .b .c
+
+# This rule has no commands and no dependencies, therefore it is incomplete
+# and not added to the transformation rules.
+#
+# See Suff_EndTransform.
+.a.b:
+
+# This rule has a dependency, therefore it is a complete transformation.
+# Its commands are taken from a .DEFAULT target, if there is any.
+.a.c: ${.PREFIX}.dependency
+
+.DEFAULT:
+	: Making ${.TARGET} from ${.IMPSRC} all ${.ALLSRC} by default.
+
+# XXX: The debug log says "transformation .DEFAULT complete", which is wrong.
+# .DEFAULT is not a transformation.
+
+# XXX: The output of this test says "Making suff-incomplete.c from
+# suff-incomplete.c".  It doesn't make sense to make something out of itself.

Reply via email to