Module Name: src
Committed By: rillig
Date: Fri Aug 28 03:51:06 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: varname-dot-includes.exp
varname-dot-includes.mk varname-dot-libs.exp varname-dot-libs.mk
Log Message:
make(1): add tests for the special .INCLUDES and .LIBS variables
To generate a diff of this commit:
cvs rdiff -u -r1.910 -r1.911 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.121 -r1.122 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/varname-dot-includes.exp \
src/usr.bin/make/unit-tests/varname-dot-includes.mk \
src/usr.bin/make/unit-tests/varname-dot-libs.exp \
src/usr.bin/make/unit-tests/varname-dot-libs.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.910 src/distrib/sets/lists/tests/mi:1.911
--- src/distrib/sets/lists/tests/mi:1.910 Thu Aug 27 19:00:17 2020
+++ src/distrib/sets/lists/tests/mi Fri Aug 28 03:51:06 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.910 2020/08/27 19:00:17 rillig Exp $
+# $NetBSD: mi,v 1.911 2020/08/28 03:51:06 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -5014,10 +5014,14 @@
./usr/tests/usr.bin/make/unit-tests/varname-dot-alltargets.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/varname-dot-curdir.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/varname-dot-curdir.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/varname-dot-includes.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/varname-dot-includes.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/varname-dot-includedfromdir.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/varname-dot-includedfromdir.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/varname-dot-includedfromfile.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/varname-dot-includedfromfile.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/varname-dot-libs.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/varname-dot-libs.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/varname-dot-make-dependfile.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/varname-dot-make-dependfile.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/varname-dot-make-expand_variables.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.121 src/usr.bin/make/unit-tests/Makefile:1.122
--- src/usr.bin/make/unit-tests/Makefile:1.121 Fri Aug 28 02:45:51 2020
+++ src/usr.bin/make/unit-tests/Makefile Fri Aug 28 03:51:06 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.121 2020/08/28 02:45:51 rillig Exp $
+# $NetBSD: Makefile,v 1.122 2020/08/28 03:51:06 rillig Exp $
#
# Unit tests for make(1)
#
@@ -272,8 +272,10 @@ TESTS+= varname
TESTS+= varname-dollar
TESTS+= varname-dot-alltargets
TESTS+= varname-dot-curdir
+TESTS+= varname-dot-includes
TESTS+= varname-dot-includedfromdir
TESTS+= varname-dot-includedfromfile
+TESTS+= varname-dot-libs
TESTS+= varname-dot-make-dependfile
TESTS+= varname-dot-make-expand_variables
TESTS+= varname-dot-make-exported
Added files:
Index: src/usr.bin/make/unit-tests/varname-dot-includes.exp
diff -u /dev/null src/usr.bin/make/unit-tests/varname-dot-includes.exp:1.1
--- /dev/null Fri Aug 28 03:51:06 2020
+++ src/usr.bin/make/unit-tests/varname-dot-includes.exp Fri Aug 28 03:51:06 2020
@@ -0,0 +1,2 @@
+.INCLUDES= -I. -I..
+exit status 0
Index: src/usr.bin/make/unit-tests/varname-dot-includes.mk
diff -u /dev/null src/usr.bin/make/unit-tests/varname-dot-includes.mk:1.1
--- /dev/null Fri Aug 28 03:51:06 2020
+++ src/usr.bin/make/unit-tests/varname-dot-includes.mk Fri Aug 28 03:51:06 2020
@@ -0,0 +1,20 @@
+# $NetBSD: varname-dot-includes.mk,v 1.1 2020/08/28 03:51:06 rillig Exp $
+#
+# Tests for the special .INCLUDES variable, which is not documented in the
+# manual page.
+#
+# It is yet unclear in which situations this feature is useful.
+
+.SUFFIXES: .h
+
+.PATH.h: . ..
+
+.INCLUDES: .h
+
+# The .INCLUDES variable is not yet available.
+.if defined(${.INCLUDES:Q})
+.error
+.endif
+
+all:
+ @echo .INCLUDES=${.INCLUDES:Q}
Index: src/usr.bin/make/unit-tests/varname-dot-libs.exp
diff -u /dev/null src/usr.bin/make/unit-tests/varname-dot-libs.exp:1.1
--- /dev/null Fri Aug 28 03:51:06 2020
+++ src/usr.bin/make/unit-tests/varname-dot-libs.exp Fri Aug 28 03:51:06 2020
@@ -0,0 +1,2 @@
+.LIBS= -L. -L..
+exit status 0
Index: src/usr.bin/make/unit-tests/varname-dot-libs.mk
diff -u /dev/null src/usr.bin/make/unit-tests/varname-dot-libs.mk:1.1
--- /dev/null Fri Aug 28 03:51:06 2020
+++ src/usr.bin/make/unit-tests/varname-dot-libs.mk Fri Aug 28 03:51:06 2020
@@ -0,0 +1,20 @@
+# $NetBSD: varname-dot-libs.mk,v 1.1 2020/08/28 03:51:06 rillig Exp $
+#
+# Tests for the special .LIBS variable, which is not documented in the
+# manual page.
+#
+# It is yet unclear in which situations this feature is useful.
+
+.SUFFIXES: .a
+
+.PATH.a: . ..
+
+.LIBS: .a
+
+# The .LIBS variable is not yet available.
+.if defined(${.LIBS:Q})
+.error
+.endif
+
+all:
+ @echo .LIBS=${.LIBS:Q}