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 tests for each debug op...
details: https://anonhg.NetBSD.org/src/rev/b654f1aeeae5
branches: trunk
changeset: 938242:b654f1aeeae5
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Sep 05 06:20:50 2020 +0000
description:
make(1): add tests for each debug option
diffstat:
distrib/sets/lists/tests/mi | 50 ++++++++++++++++++++++++++-
usr.bin/make/unit-tests/Makefile | 26 +++++++++++++-
usr.bin/make/unit-tests/archive.mk | 25 +++++++++----
usr.bin/make/unit-tests/opt-debug-all.exp | 1 +
usr.bin/make/unit-tests/opt-debug-all.mk | 10 +++++
usr.bin/make/unit-tests/opt-debug-archive.exp | 1 +
usr.bin/make/unit-tests/opt-debug-archive.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-cond.exp | 1 +
usr.bin/make/unit-tests/opt-debug-cond.mk | 10 +++++
usr.bin/make/unit-tests/opt-debug-curdir.exp | 1 +
usr.bin/make/unit-tests/opt-debug-curdir.mk | 8 ++++
usr.bin/make/unit-tests/opt-debug-dir.exp | 1 +
usr.bin/make/unit-tests/opt-debug-dir.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-errors.exp | 1 +
usr.bin/make/unit-tests/opt-debug-errors.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-file.exp | 1 +
usr.bin/make/unit-tests/opt-debug-file.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-for.exp | 1 +
usr.bin/make/unit-tests/opt-debug-for.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-graph1.exp | 1 +
usr.bin/make/unit-tests/opt-debug-graph1.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-graph2.exp | 1 +
usr.bin/make/unit-tests/opt-debug-graph2.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-graph3.exp | 1 +
usr.bin/make/unit-tests/opt-debug-graph3.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-hash.exp | 1 +
usr.bin/make/unit-tests/opt-debug-hash.mk | 10 +++++
usr.bin/make/unit-tests/opt-debug-jobs.exp | 1 +
usr.bin/make/unit-tests/opt-debug-jobs.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-lint.exp | 1 +
usr.bin/make/unit-tests/opt-debug-lint.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-loud.exp | 1 +
usr.bin/make/unit-tests/opt-debug-loud.mk | 13 +++++++
usr.bin/make/unit-tests/opt-debug-making.exp | 1 +
usr.bin/make/unit-tests/opt-debug-making.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-meta.exp | 1 +
usr.bin/make/unit-tests/opt-debug-meta.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-no-rm.exp | 1 +
usr.bin/make/unit-tests/opt-debug-no-rm.mk | 13 +++++++
usr.bin/make/unit-tests/opt-debug-parse.exp | 1 +
usr.bin/make/unit-tests/opt-debug-parse.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-suff.exp | 1 +
usr.bin/make/unit-tests/opt-debug-suff.mk | 11 +++++
usr.bin/make/unit-tests/opt-debug-targets.exp | 1 +
usr.bin/make/unit-tests/opt-debug-targets.mk | 11 +++++
usr.bin/make/unit-tests/opt-debug-var.exp | 1 +
usr.bin/make/unit-tests/opt-debug-var.mk | 9 ++++
usr.bin/make/unit-tests/opt-debug-varraw.exp | 1 +
usr.bin/make/unit-tests/opt-debug-varraw.mk | 12 ++++++
usr.bin/make/unit-tests/opt-debug-x-trace.exp | 1 +
usr.bin/make/unit-tests/opt-debug-x-trace.mk | 10 +++++
51 files changed, 349 insertions(+), 10 deletions(-)
diffs (truncated from 607 to 300 lines):
diff -r 66795d63fd29 -r b654f1aeeae5 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Sat Sep 05 04:11:10 2020 +0000
+++ b/distrib/sets/lists/tests/mi Sat Sep 05 06:20:50 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.918 2020/09/04 17:05:39 rillig Exp $
+# $NetBSD: mi,v 1.919 2020/09/05 06:20:50 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -4812,8 +4812,56 @@
./usr/tests/usr.bin/make/unit-tests/opt-backwards.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/opt-chdir.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/opt-chdir.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-all.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-all.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-archive.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-archive.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-cond.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-cond.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-curdir.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-curdir.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-dir.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-dir.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-errors.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-errors.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-file.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-file.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-for.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-for.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/opt-debug-g1.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/opt-debug-g1.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-graph1.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-graph1.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-graph2.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-graph2.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-graph3.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-graph3.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-hash.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-hash.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-jobs.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-jobs.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-lint.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-lint.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-loud.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-loud.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-making.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-making.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-meta.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-meta.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-no-rm.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-no-rm.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-parse.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-parse.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-suff.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-suff.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-targets.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-targets.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-var.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-var.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-varraw.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-varraw.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-x-trace.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-debug-x-trace.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/opt-debug.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/opt-debug.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/opt-define.exp tests-usr.bin-tests compattestfile,atf
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Sat Sep 05 04:11:10 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile Sat Sep 05 06:20:50 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.133 2020/09/04 19:03:38 rillig Exp $
+# $NetBSD: Makefile,v 1.134 2020/09/05 06:20:51 rillig Exp $
#
# Unit tests for make(1)
#
@@ -171,7 +171,31 @@
TESTS+= opt-backwards
TESTS+= opt-chdir
TESTS+= opt-debug
+TESTS+= opt-debug-all
+TESTS+= opt-debug-archive
+TESTS+= opt-debug-curdir
+TESTS+= opt-debug-cond
+TESTS+= opt-debug-dir
+TESTS+= opt-debug-errors
+TESTS+= opt-debug-file
+TESTS+= opt-debug-for
TESTS+= opt-debug-g1
+TESTS+= opt-debug-graph1
+TESTS+= opt-debug-graph2
+TESTS+= opt-debug-graph3
+TESTS+= opt-debug-hash
+TESTS+= opt-debug-jobs
+TESTS+= opt-debug-lint
+TESTS+= opt-debug-loud
+TESTS+= opt-debug-meta
+TESTS+= opt-debug-making
+TESTS+= opt-debug-no-rm
+TESTS+= opt-debug-parse
+TESTS+= opt-debug-suff
+TESTS+= opt-debug-targets
+TESTS+= opt-debug-varraw
+TESTS+= opt-debug-var
+TESTS+= opt-debug-x-trace
TESTS+= opt-define
TESTS+= opt-env
TESTS+= opt-file
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/archive.mk
--- a/usr.bin/make/unit-tests/archive.mk Sat Sep 05 04:11:10 2020 +0000
+++ b/usr.bin/make/unit-tests/archive.mk Sat Sep 05 06:20:50 2020 +0000
@@ -1,21 +1,25 @@
-# $NetBSD: archive.mk,v 1.6 2020/09/04 19:03:38 rillig Exp $
+# $NetBSD: archive.mk,v 1.7 2020/09/05 06:20:51 rillig Exp $
#
# Very basic demonstration of handling archives, based on the description
# in PSD.doc/tutorial.ms.
+#
+# This test aims at covering the code, not at being an introduction to
+# archive handling. That's why it is more complicated and detailed than
+# strictly necessary.
-ARCHIVE= libprog.${EXT.a}
-FILES= archive.${EXT.mk} modmisc.${EXT.mk} varmisc.mk
-
-EXT.a= a
-EXT.mk= mk
+ARCHIVE= libprog.a
+FILES= archive.mk modmisc.mk varmisc.mk
MAKE_CMD= ${.MAKE} -f ${MAKEFILE}
RUN?= @set -eu;
all:
.if ${.PARSEDIR:tA} != ${.CURDIR:tA}
- @cd ${MAKEFILE:H} && cp [at]*.mk ${.CURDIR}
+ @cd ${MAKEFILE:H} && cp ${FILES} t*.mk ${.CURDIR}
.endif
+# The following targets are run in sub-makes to ensure that they get the
+# current state of the filesystem right, since they creating and removing
+# files.
${RUN} ${MAKE_CMD} remove-archive
${RUN} ${MAKE_CMD} create-archive
${RUN} ${MAKE_CMD} list-archive
@@ -25,7 +29,12 @@
${RUN} ${MAKE_CMD} remove-archive
create-archive: ${ARCHIVE}
-${ARCHIVE}: ${ARCHIVE}(${FILES})
+
+# The indirect references with the $$ cover the code in Arch_ParseArchive
+# that calls Var_Parse. It's an esoteric scenario since at the point where
+# Arch_ParseArchive is called, the dependency line is already fully expanded.
+#
+${ARCHIVE}: $${:Ulibprog.a}(archive.mk modmisc.mk $${:Uvarmisc.mk})
ar cru ${.TARGET} ${.OODATE}
ranlib ${.TARGET}
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-all.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-all.exp Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,1 @@
+exit status 0
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-all.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-all.mk Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,10 @@
+# $NetBSD: opt-debug-all.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+#
+# Tests for the -dA command line option, which enables all debug options
+# except for -dL (lint), since that option is not related to debug logging
+# but to static analysis.
+
+# TODO: Implementation
+
+all:
+ @:;
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-archive.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-archive.exp Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,1 @@
+exit status 0
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-archive.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-archive.mk Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: opt-debug-archive.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+#
+# Tests for the -da command line option, which adds debug logging for the
+# archive handling.
+
+# TODO: Implementation
+
+all:
+ @:;
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-cond.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-cond.exp Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,1 @@
+exit status 0
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-cond.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-cond.mk Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,10 @@
+# $NetBSD: opt-debug-cond.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+#
+# Tests for the -dc command line option, which adds debug logging for the
+# evaluation of conditional expressions, such as in .if directives and
+# ${cond:?then:else} expressions.
+
+# TODO: Implementation
+
+all:
+ @:;
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-curdir.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-curdir.exp Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,1 @@
+exit status 0
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-curdir.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-curdir.mk Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,8 @@
+# $NetBSD: opt-debug-curdir.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+#
+# Tests for the -dC command line option, which does nothing, as of 2020-09-05.
+
+# TODO: Implementation
+
+all:
+ @:;
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-dir.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-dir.exp Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,1 @@
+exit status 0
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-dir.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-dir.mk Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: opt-debug-dir.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+#
+# Tests for the -dd command line option, which adds debug logging for
+# directory searching and caching.
+
+# TODO: Implementation
+
+all:
+ @:;
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-errors.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-errors.exp Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,1 @@
+exit status 0
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-errors.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-errors.mk Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: opt-debug-errors.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+#
+# Tests for the -de command line option, which adds debug logging for
+# failed commands and targets.
+
+# TODO: Implementation
+
+all:
+ @:;
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-file.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-file.exp Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,1 @@
+exit status 0
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-file.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-file.mk Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: opt-debug-file.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+#
+# Tests for the -dF command line option, which redirects the debug log
+# to a file instead of writing it to stderr.
+
+# TODO: Implementation
+
+all:
+ @:;
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-for.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-for.exp Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,1 @@
+exit status 0
diff -r 66795d63fd29 -r b654f1aeeae5 usr.bin/make/unit-tests/opt-debug-for.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-for.mk Sat Sep 05 06:20:50 2020 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: opt-debug-for.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+#
+# Tests for the -df command line option, which adds debug logging for
+# parsing and evaluating .for loops.
+
+# TODO: Implementation
+
Home |
Main Index |
Thread Index |
Old Index