summaryrefslogtreecommitdiff
path: root/usr.bin/make/unit-tests
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2020-11-14 15:35:20 +0000
committerrillig <rillig@NetBSD.org>2020-11-14 15:35:20 +0000
commitba201db8a7ca705b1f575286eaeeb9f9deda22cf (patch)
tree49ce7c1055969638eac77d759de450611368521d /usr.bin/make/unit-tests
parent8d2df5affc3e9a6e32289d8210fb937c52926a68 (diff)
make(1): add test for the -t option in jobs mode
Diffstat (limited to 'usr.bin/make/unit-tests')
-rw-r--r--usr.bin/make/unit-tests/Makefile3
-rw-r--r--usr.bin/make/unit-tests/opt-touch-jobs.exp4
-rw-r--r--usr.bin/make/unit-tests/opt-touch-jobs.mk30
3 files changed, 36 insertions, 1 deletions
diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile
index 1eeb229dc67..42394eadf16 100644
--- a/usr.bin/make/unit-tests/Makefile
+++ b/usr.bin/make/unit-tests/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.198 2020/11/12 23:35:21 sjg Exp $
+# $NetBSD: Makefile,v 1.199 2020/11/14 15:35:20 rillig Exp $
#
# Unit tests for make(1)
#
@@ -232,6 +232,7 @@ TESTS+= opt-query
TESTS+= opt-raw
TESTS+= opt-silent
TESTS+= opt-touch
+TESTS+= opt-touch-jobs
TESTS+= opt-tracefile
TESTS+= opt-var-expanded
TESTS+= opt-var-literal
diff --git a/usr.bin/make/unit-tests/opt-touch-jobs.exp b/usr.bin/make/unit-tests/opt-touch-jobs.exp
new file mode 100644
index 00000000000..0cfde513519
--- /dev/null
+++ b/usr.bin/make/unit-tests/opt-touch-jobs.exp
@@ -0,0 +1,4 @@
+: Making opt-touch-make.
+`opt-touch-join' is up to date.
+`opt-touch-use' is up to date.
+exit status 0
diff --git a/usr.bin/make/unit-tests/opt-touch-jobs.mk b/usr.bin/make/unit-tests/opt-touch-jobs.mk
new file mode 100644
index 00000000000..4402d76e957
--- /dev/null
+++ b/usr.bin/make/unit-tests/opt-touch-jobs.mk
@@ -0,0 +1,30 @@
+# $NetBSD: opt-touch-jobs.mk,v 1.1 2020/11/14 15:35:20 rillig Exp $
+#
+# Tests for the -t command line option in jobs mode.
+
+.MAKEFLAGS: -j1
+.MAKEFLAGS: -t
+.MAKEFLAGS: opt-touch-phony
+.MAKEFLAGS: opt-touch-join
+.MAKEFLAGS: opt-touch-use
+.MAKEFLAGS: opt-touch-make
+
+opt-touch-phony: .PHONY
+ : Making $@.
+
+opt-touch-join: .JOIN
+ : Making $@.
+
+opt-touch-use: .USE
+ : Making use of $@.
+
+# Even though it is listed last, in the output it appears first.
+# This is because it is the only node that actually needs to be run.
+# The "is up to date" of the other nodes happens after all jobs have
+# finished, by Make_Run > MakePrintStatusList > MakePrintStatus.
+opt-touch-make: .MAKE
+ : Making $@.
+
+.END:
+ @files=$$(ls opt-touch-* 2>/dev/null | grep -v -e '\.' -e '\*'); \
+ [ -z "$$files" ] || { echo "created files: $$files" 1>&2; exit 1; }