Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make tests/make: adjust expectations to actual behavior



details:   https://anonhg.NetBSD.org/src/rev/e31eccd432cc
branches:  trunk
changeset: 365220:e31eccd432cc
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Apr 15 09:33:20 2022 +0000

description:
tests/make: adjust expectations to actual behavior

The bug in deptgt-silent-jobs.mk has been fixed, the debug logging for
comparing conditions and for deleting global variables has changed
intentionally.

diffstat:

 usr.bin/make/cond.c                             |  6 +++---
 usr.bin/make/unit-tests/check-expect.lua        |  8 ++++++--
 usr.bin/make/unit-tests/deptgt-silent-jobs.mk   |  3 +--
 usr.bin/make/unit-tests/opt-debug-cond.mk       |  6 +++---
 usr.bin/make/unit-tests/varname-dot-suffixes.mk |  6 +++---
 5 files changed, 16 insertions(+), 13 deletions(-)

diffs (117 lines):

diff -r 5ae18b4d909d -r e31eccd432cc usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Thu Apr 14 19:47:14 2022 +0000
+++ b/usr.bin/make/cond.c       Fri Apr 15 09:33:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.333 2022/03/03 19:46:31 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.334 2022/04/15 09:33:20 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.333 2022/03/03 19:46:31 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.334 2022/04/15 09:33:20 rillig Exp $");
 
 /*
  * Conditional expressions conform to this grammar:
@@ -710,7 +710,7 @@
        return true;
 }
 
-/* Parse a function call expression, such as 'defined(${file})'. */
+/* Parse a function call expression, such as 'exists(${file})'. */
 static bool
 CondParser_FuncCall(CondParser *par, bool doEval, Token *out_token)
 {
diff -r 5ae18b4d909d -r e31eccd432cc usr.bin/make/unit-tests/check-expect.lua
--- a/usr.bin/make/unit-tests/check-expect.lua  Thu Apr 14 19:47:14 2022 +0000
+++ b/usr.bin/make/unit-tests/check-expect.lua  Fri Apr 15 09:33:20 2022 +0000
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.2 2022/01/29 00:52:53 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.3 2022/04/15 09:33:20 rillig Exp $
 
 --[[
 
@@ -72,7 +72,11 @@
   for mk_lineno, mk_line in ipairs(mk_lines) do
     for text in mk_line:gmatch("#%s*expect:%s*(.*)") do
       local i = prev_expect_line
-      while i < #exp_lines and text ~= exp_lines[i + 1] do
+      -- As of 2022-04-15, some lines in the .exp files contain trailing
+      -- whitespace.  If possible, this should be avoided by rewriting the
+      -- debug logging.  When done, the gsub can be removed.
+      -- See deptgt-phony.exp lines 14 and 15.
+      while i < #exp_lines and text ~= exp_lines[i + 1]:gsub("%s*$", "") do
         i = i + 1
       end
       if i < #exp_lines then
diff -r 5ae18b4d909d -r e31eccd432cc usr.bin/make/unit-tests/deptgt-silent-jobs.mk
--- a/usr.bin/make/unit-tests/deptgt-silent-jobs.mk     Thu Apr 14 19:47:14 2022 +0000
+++ b/usr.bin/make/unit-tests/deptgt-silent-jobs.mk     Fri Apr 15 09:33:20 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt-silent-jobs.mk,v 1.2 2022/02/12 11:14:48 rillig Exp $
+# $NetBSD: deptgt-silent-jobs.mk,v 1.3 2022/04/15 09:33:20 rillig Exp $
 #
 # Ensure that the special dependency target '.SILENT' only affects the amount
 # of output, but not the kind of error handling.
@@ -28,7 +28,6 @@
        @${MAKE} -r -f ${MAKEFILE} test VARIANT=compat
 
 # expect: jobs: testing 1
-# expect: echo 'jobs: testing 2'
 # expect: jobs: testing 2
 # expect: jobs: testing 3
 jobs:
diff -r 5ae18b4d909d -r e31eccd432cc usr.bin/make/unit-tests/opt-debug-cond.mk
--- a/usr.bin/make/unit-tests/opt-debug-cond.mk Thu Apr 14 19:47:14 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-cond.mk Fri Apr 15 09:33:20 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: opt-debug-cond.mk,v 1.2 2022/01/23 16:09:38 rillig Exp $
+# $NetBSD: opt-debug-cond.mk,v 1.3 2022/04/15 09:33:20 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
@@ -7,11 +7,11 @@
 .MAKEFLAGS: -dc
 
 # expect: CondParser_Eval: ${:U12345} > ${:U55555}
-# expect: lhs = 12345.000000, rhs = 55555.000000, op = >
+# expect: Comparing 12345.000000 > 55555.000000
 .if ${:U12345} > ${:U55555}
 
 # expect: CondParser_Eval: "string" != "string"
-# expect: lhs = "string", rhs = "string", op = !=
+# expect: Comparing "string" != "string"
 .elif "string" != "string"
 
 # expect: CondParser_Eval: "nonempty"
diff -r 5ae18b4d909d -r e31eccd432cc usr.bin/make/unit-tests/varname-dot-suffixes.mk
--- a/usr.bin/make/unit-tests/varname-dot-suffixes.mk   Thu Apr 14 19:47:14 2022 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-suffixes.mk   Fri Apr 15 09:33:20 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varname-dot-suffixes.mk,v 1.2 2022/01/15 12:35:18 rillig Exp $
+# $NetBSD: varname-dot-suffixes.mk,v 1.3 2022/04/15 09:33:20 rillig Exp $
 #
 # Tests for the special "variable" .SUFFIXES, which lists the suffixes that
 # have been registered for use in suffix transformation rules.  Suffixes are
@@ -51,7 +51,7 @@
 # Deleting .SUFFIXES has no effect since there is no actual variable of that
 # name.
 .MAKEFLAGS: -dv
-# expect: Global:delete .SUFFIXES (not found)
+# expect: Global: delete .SUFFIXES (not found)
 .undef .SUFFIXES
 .MAKEFLAGS: -d0
 .if ${.SUFFIXES} != ".c .o .1 .err .tar.gz"
@@ -97,7 +97,7 @@
 # expect: Command: .SUFFIXES = 1 ignored (read-only)
 # expect: Command: .SUFFIXES = 2 ignored (read-only)
 # XXX: Missing space after ':'
-# expect: Command:delete .SUFFIXES (not found)
+# expect: Command: delete .SUFFIXES (not found)
 .if ${1 2:L:@.SUFFIXES@${.SUFFIXES}@} != ".c .o .1 .err .tar.gz .c .o .1 .err .tar.gz"
 .  error
 .endif



Home | Main Index | Thread Index | Old Index