Module Name: src
Committed By: rillig
Date: Sat Nov 7 20:01:17 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: job-flags.exp job-flags.mk
Log Message:
make(1): add test for job command flags
To generate a diff of this commit:
cvs rdiff -u -r1.961 -r1.962 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.188 -r1.189 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/job-flags.exp \
src/usr.bin/make/unit-tests/job-flags.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.961 src/distrib/sets/lists/tests/mi:1.962
--- src/distrib/sets/lists/tests/mi:1.961 Wed Nov 4 04:24:57 2020
+++ src/distrib/sets/lists/tests/mi Sat Nov 7 20:01:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.961 2020/11/04 04:24:57 rillig Exp $
+# $NetBSD: mi,v 1.962 2020/11/07 20:01:17 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -5097,6 +5097,8 @@
./usr/tests/usr.bin/make/unit-tests/include-main.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/include-sub.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/include-subsub.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/job-flags.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/job-flags.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/job-output-long-lines.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/job-output-long-lines.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/lint.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.188 src/usr.bin/make/unit-tests/Makefile:1.189
--- src/usr.bin/make/unit-tests/Makefile:1.188 Wed Nov 4 04:24:57 2020
+++ src/usr.bin/make/unit-tests/Makefile Sat Nov 7 20:01:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.188 2020/11/04 04:24:57 rillig Exp $
+# $NetBSD: Makefile,v 1.189 2020/11/07 20:01:17 rillig Exp $
#
# Unit tests for make(1)
#
@@ -175,6 +175,7 @@ TESTS+= forsubst
TESTS+= hanoi-include
TESTS+= impsrc
TESTS+= include-main
+TESTS+= job-flags
TESTS+= job-output-long-lines
TESTS+= lint
TESTS+= make-exported
Added files:
Index: src/usr.bin/make/unit-tests/job-flags.exp
diff -u /dev/null src/usr.bin/make/unit-tests/job-flags.exp:1.1
--- /dev/null Sat Nov 7 20:01:17 2020
+++ src/usr.bin/make/unit-tests/job-flags.exp Sat Nov 7 20:01:17 2020
@@ -0,0 +1,8 @@
+.BEGIN
+silent
+ignore
+true in ignore
+false in ignore
+*** [ignore] Error code 1 (ignored)
+.END
+exit status 0
Index: src/usr.bin/make/unit-tests/job-flags.mk
diff -u /dev/null src/usr.bin/make/unit-tests/job-flags.mk:1.1
--- /dev/null Sat Nov 7 20:01:17 2020
+++ src/usr.bin/make/unit-tests/job-flags.mk Sat Nov 7 20:01:17 2020
@@ -0,0 +1,23 @@
+# $NetBSD: job-flags.mk,v 1.1 2020/11/07 20:01:17 rillig Exp $
+#
+# Tests for Job.flags, which are controlled by special source dependencies
+# like .SILENT or .IGNORE, as well as the command line options -s or -i.
+
+.MAKEFLAGS: -j1
+
+all: silent .WAIT ignore
+
+.BEGIN:
+ @echo $@
+
+silent: .SILENT
+ echo $@
+
+ignore: .IGNORE
+ @echo $@
+ true in $@
+ false in $@
+ @echo 'Still there in $@'
+
+.END:
+ @echo $@