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): test all combinations of sw...



details:   https://anonhg.NetBSD.org/src/rev/ae7f8f1f714f
branches:  trunk
changeset: 1017017:ae7f8f1f714f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Dec 10 17:06:13 2020 +0000

description:
make(1): test all combinations of switches for running commands

The code in JobPrintSpecials is rather complicated and contains
surprising interaction between some of the switches.

To see the exact effects of the switches, record the current state and
its output, to prevent accidental breakage during the upcoming
refactorings.

diffstat:

 distrib/sets/lists/tests/mi          |     4 +-
 usr.bin/make/unit-tests/Makefile     |     4 +-
 usr.bin/make/unit-tests/sh-flags.exp |  7637 ++++++++++++++++++++++++++++++++++
 usr.bin/make/unit-tests/sh-flags.mk  |   131 +
 4 files changed, 7774 insertions(+), 2 deletions(-)

diffs (truncated from 7819 to 300 lines):

diff -r b22441a2ec15 -r ae7f8f1f714f distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Thu Dec 10 17:02:51 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Thu Dec 10 17:06:13 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.987 2020/12/09 07:57:51 rillig Exp $
+# $NetBSD: mi,v 1.988 2020/12/10 17:06:13 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5273,6 +5273,8 @@
 ./usr/tests/usr.bin/make/unit-tests/recursive.mk                               tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/sh-dots.exp                                        tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/sh-dots.mk                                 tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/sh-flags.exp                               tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/sh-flags.mk                                        tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/sh-jobs-error.exp                          tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/sh-jobs-error.mk                           tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/sh-jobs.exp                                        tests-usr.bin-tests     compattestfile,atf
diff -r b22441a2ec15 -r ae7f8f1f714f usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Thu Dec 10 17:02:51 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Thu Dec 10 17:06:13 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.243 2020/12/09 08:18:35 rillig Exp $
+# $NetBSD: Makefile,v 1.244 2020/12/10 17:06:13 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -262,6 +262,7 @@
 TESTS+=                recursive
 TESTS+=                sh
 TESTS+=                sh-dots
+TESTS+=                sh-flags
 TESTS+=                sh-jobs
 TESTS+=                sh-jobs-error
 TESTS+=                sh-leading-at
@@ -483,6 +484,7 @@
 # For Compat_RunCommand, useShell == TRUE.
 SED_CMDS.sh-dots+=             -e 's,^make: exec(\(.*\)) failed (.*)$$,<not found: \1>,'
 SED_CMDS.sh-dots+=             -e 's,^\(\*\*\* Error code \)[1-9][0-9]*,\1<nonzero>,'
+SED_CMDS.sh-flags=             ${STD_SED_CMDS.hide-from-output}
 SED_CMDS.suff-main+=           ${STD_SED_CMDS.dg1}
 SED_CMDS.suff-main-several+=   ${STD_SED_CMDS.dg1}
 SED_CMDS.suff-transform-debug+=        ${STD_SED_CMDS.dg1}
diff -r b22441a2ec15 -r ae7f8f1f714f usr.bin/make/unit-tests/sh-flags.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/sh-flags.exp      Thu Dec 10 17:06:13 2020 +0000
@@ -0,0 +1,7637 @@
+opt-______-tgt-___-cmd-___
+echo running
+running
+
+opt-______-tgt-___-cmd-__s
+running
+
+opt-______-tgt-___-cmd-_i_
+echo running; false
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-___-cmd-_is
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-___-cmd-a__
+echo running
+running
+
+opt-______-tgt-___-cmd-a_s
+running
+
+opt-______-tgt-___-cmd-ai_
+echo running; false
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-___-cmd-ais
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-__s-cmd-___
+running
+
+opt-______-tgt-__s-cmd-__s
+running
+
+opt-______-tgt-__s-cmd-_i_
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-__s-cmd-_is
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-__s-cmd-a__
+running
+
+opt-______-tgt-__s-cmd-a_s
+running
+
+opt-______-tgt-__s-cmd-ai_
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-__s-cmd-ais
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-_i_-cmd-___
+echo running
+running
+
+opt-______-tgt-_i_-cmd-__s
+running
+
+opt-______-tgt-_i_-cmd-_i_
+echo running; false
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-_i_-cmd-_is
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-_i_-cmd-a__
+echo running
+running
+
+opt-______-tgt-_i_-cmd-a_s
+running
+
+opt-______-tgt-_i_-cmd-ai_
+echo running; false
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-_i_-cmd-ais
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-_is-cmd-___
+running
+
+opt-______-tgt-_is-cmd-__s
+running
+
+opt-______-tgt-_is-cmd-_i_
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-_is-cmd-_is
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-_is-cmd-a__
+running
+
+opt-______-tgt-_is-cmd-a_s
+running
+
+opt-______-tgt-_is-cmd-ai_
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-_is-cmd-ais
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-a__-cmd-___
+echo running
+running
+
+opt-______-tgt-a__-cmd-__s
+running
+
+opt-______-tgt-a__-cmd-_i_
+echo running; false
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-a__-cmd-_is
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-a__-cmd-a__
+echo running
+running
+
+opt-______-tgt-a__-cmd-a_s
+running
+
+opt-______-tgt-a__-cmd-ai_
+echo running; false
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-a__-cmd-ais
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-a_s-cmd-___
+running
+
+opt-______-tgt-a_s-cmd-__s
+running
+
+opt-______-tgt-a_s-cmd-_i_
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-a_s-cmd-_is
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-a_s-cmd-a__
+running
+
+opt-______-tgt-a_s-cmd-a_s
+running
+
+opt-______-tgt-a_s-cmd-ai_
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-a_s-cmd-ais
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-ai_-cmd-___
+echo running
+running
+
+opt-______-tgt-ai_-cmd-__s
+running
+
+opt-______-tgt-ai_-cmd-_i_
+echo running; false
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-ai_-cmd-_is
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-ai_-cmd-a__
+echo running
+running
+
+opt-______-tgt-ai_-cmd-a_s
+running
+
+opt-______-tgt-ai_-cmd-ai_
+echo running; false
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-ai_-cmd-ais
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-ais-cmd-___
+running
+
+opt-______-tgt-ais-cmd-__s
+running
+
+opt-______-tgt-ais-cmd-_i_
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-ais-cmd-_is
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-ais-cmd-a__
+running
+
+opt-______-tgt-ais-cmd-a_s
+running
+
+opt-______-tgt-ais-cmd-ai_
+running
+*** Error code 1 (ignored)
+
+opt-______-tgt-ais-cmd-ais
+running
+*** Error code 1 (ignored)
+
+opt-____s_-tgt-___-cmd-___
+running
+
+opt-____s_-tgt-___-cmd-__s
+running
+
+opt-____s_-tgt-___-cmd-_i_
+running
+*** Error code 1 (ignored)
+
+opt-____s_-tgt-___-cmd-_is
+running
+*** Error code 1 (ignored)



Home | Main Index | Thread Index | Old Index