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): improve output grouping in ...



details:   https://anonhg.NetBSD.org/src/rev/c85c13148e3f
branches:  trunk
changeset: 1012529:c85c13148e3f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 01 15:28:28 2020 +0000

description:
make(1): improve output grouping in varmod-edge test

The generated error messages are now closer to the test cases that
produce them.  To keep the expected output stable, the line numbers are
omitted from the .info directives.

diffstat:

 usr.bin/make/unit-tests/Makefile        |   3 ++-
 usr.bin/make/unit-tests/varmod-edge.exp |  33 +++++++++++++++++----------------
 usr.bin/make/unit-tests/varmod-edge.mk  |  11 ++++++-----
 3 files changed, 25 insertions(+), 22 deletions(-)

diffs (86 lines):

diff -r 6b45074afb19 -r c85c13148e3f usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Sat Aug 01 15:16:15 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Sat Aug 01 15:28:28 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.78 2020/07/31 22:07:28 rillig Exp $
+# $NetBSD: Makefile,v 1.79 2020/08/01 15:28:28 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -100,6 +100,7 @@
 # Some tests need extra post-processing.
 SED_CMDS.moderrs+=     -e 's,\(substitution error:\).*,\1 (details omitted),'
 SED_CMDS.modmisc+=     -e 's,\(substitution error:\).*,\1 (details omitted),'
+SED_CMDS.varmod-edge+= -e 's, line [0-9]*:, line omitted:,'
 SED_CMDS.varshell+=    -e 's,^[a-z]*sh: ,,'
 SED_CMDS.varshell+=    -e '/command/s,No such.*,not found,'
 
diff -r 6b45074afb19 -r c85c13148e3f usr.bin/make/unit-tests/varmod-edge.exp
--- a/usr.bin/make/unit-tests/varmod-edge.exp   Sat Aug 01 15:16:15 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-edge.exp   Sat Aug 01 15:28:28 2020 +0000
@@ -1,21 +1,22 @@
+make: "varmod-edge.mk" line omitted: ok M-paren
+make: "varmod-edge.mk" line omitted: ok M-mixed
+make: "varmod-edge.mk" line omitted: ok M-unescape
 make: Unclosed variable specification (expecting '}') for "" (value "*)") modifier U
+make: "varmod-edge.mk" line omitted: ok M-nest-mix
+make: "varmod-edge.mk" line omitted: ok M-nest-brk
+make: "varmod-edge.mk" line omitted: ok M-pat-err
+make: "varmod-edge.mk" line omitted: ok M-bsbs
+make: "varmod-edge.mk" line omitted: ok M-bs1-par
+make: "varmod-edge.mk" line omitted: ok M-bs2-par
+make: "varmod-edge.mk" line omitted: ok M-128
+make: "varmod-edge.mk" line omitted: ok eq-ext
+make: "varmod-edge.mk" line omitted: ok eq-q
+make: "varmod-edge.mk" line omitted: ok eq-bs
 make: Unclosed substitution for INP.eq-esc (= missing)
+make: "varmod-edge.mk" line omitted: ok eq-esc
+make: "varmod-edge.mk" line omitted: ok colon
 make: Unknown modifier ':'
 make: Unknown modifier ':'
-ok M-paren
-ok M-mixed
-ok M-unescape
-ok M-nest-mix
-ok M-nest-brk
-ok M-pat-err
-ok M-bsbs
-ok M-bs1-par
-ok M-bs2-par
-ok M-128
-ok eq-ext
-ok eq-q
-ok eq-bs
-ok eq-esc
-ok colon
-ok colons
+make: "varmod-edge.mk" line omitted: ok colons
+ok
 exit status 0
diff -r 6b45074afb19 -r c85c13148e3f usr.bin/make/unit-tests/varmod-edge.mk
--- a/usr.bin/make/unit-tests/varmod-edge.mk    Sat Aug 01 15:16:15 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-edge.mk    Sat Aug 01 15:28:28 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-edge.mk,v 1.10 2020/08/01 15:16:15 rillig Exp $
+# $NetBSD: varmod-edge.mk,v 1.11 2020/08/01 15:28:28 rillig Exp $
 #
 # Tests for edge cases in variable modifiers.
 #
@@ -161,12 +161,13 @@
 MOD.colons=    ${INP.colons::::}
 EXP.colons=    # empty
 
-all:
 .for test in ${TESTS}
 .  if ${MOD.${test}} == ${EXP.${test}}
-       @printf 'ok %s\n' ${test:Q}''
+.info ok ${test}
 .  else
-       @printf 'error in %s: expected %s, got %s\n' \
-               ${test:Q}'' ${EXP.${test}:Q}'' ${MOD.${test}:Q}''
+.warning error in ${test}: expected "${EXP.${test}}", got "${MOD.${test}}"
 .  endif
 .endfor
+
+all:
+       @echo ok



Home | Main Index | Thread Index | Old Index