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 the -t option ...



details:   https://anonhg.NetBSD.org/src/rev/a2817e4eea1b
branches:  trunk
changeset: 957017:a2817e4eea1b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 14 15:35:20 2020 +0000

description:
make(1): add test for the -t option in jobs mode

diffstat:

 distrib/sets/lists/tests/mi                |   4 +++-
 usr.bin/make/unit-tests/Makefile           |   3 ++-
 usr.bin/make/unit-tests/opt-touch-jobs.exp |   4 ++++
 usr.bin/make/unit-tests/opt-touch-jobs.mk  |  30 ++++++++++++++++++++++++++++++
 4 files changed, 39 insertions(+), 2 deletions(-)

diffs (77 lines):

diff -r 9cfe2e180cff -r a2817e4eea1b distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sat Nov 14 15:03:37 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Sat Nov 14 15:35:20 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.968 2020/11/13 17:19:06 sjg Exp $
+# $NetBSD: mi,v 1.969 2020/11/14 15:35:20 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5213,6 +5213,8 @@
 ./usr/tests/usr.bin/make/unit-tests/opt-raw.mk                                 tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-silent.exp                             tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-silent.mk                              tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-touch-jobs.exp                         tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-touch-jobs.mk                          tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-touch.exp                              tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-touch.mk                               tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-tracefile.exp                          tests-usr.bin-tests     compattestfile,atf
diff -r 9cfe2e180cff -r a2817e4eea1b usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Sat Nov 14 15:03:37 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Sat Nov 14 15:35:20 2020 +0000
@@ -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-raw
 TESTS+=                opt-silent
 TESTS+=                opt-touch
+TESTS+=                opt-touch-jobs
 TESTS+=                opt-tracefile
 TESTS+=                opt-var-expanded
 TESTS+=                opt-var-literal
diff -r 9cfe2e180cff -r a2817e4eea1b usr.bin/make/unit-tests/opt-touch-jobs.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-touch-jobs.exp        Sat Nov 14 15:35:20 2020 +0000
@@ -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 -r 9cfe2e180cff -r a2817e4eea1b usr.bin/make/unit-tests/opt-touch-jobs.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-touch-jobs.mk Sat Nov 14 15:35:20 2020 +0000
@@ -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; }



Home | Main Index | Thread Index | Old Index