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 tests/make: test line numbers in deb...



details:   https://anonhg.NetBSD.org/src/rev/82073add6128
branches:  trunk
changeset: 359528:82073add6128
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 08 22:13:43 2022 +0000

description:
tests/make: test line numbers in debug output for parsing files

diffstat:

 usr.bin/make/unit-tests/hanoi-include.mk    |  6 +++---
 usr.bin/make/unit-tests/opt-debug-parse.exp |  8 +++++++-
 usr.bin/make/unit-tests/opt-debug-parse.mk  |  7 +++++--
 3 files changed, 15 insertions(+), 6 deletions(-)

diffs (57 lines):

diff -r 1ebb120f11dc -r 82073add6128 usr.bin/make/unit-tests/hanoi-include.mk
--- a/usr.bin/make/unit-tests/hanoi-include.mk  Sat Jan 08 21:28:59 2022 +0000
+++ b/usr.bin/make/unit-tests/hanoi-include.mk  Sat Jan 08 22:13:43 2022 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: hanoi-include.mk,v 1.1 2020/10/03 17:30:54 rillig Exp $
+# $NetBSD: hanoi-include.mk,v 1.2 2022/01/08 22:13:43 rillig Exp $
 #
 # Implements the Towers of Hanoi puzzle, thereby demonstrating a bunch of
-# useful programming techniques:
+# more or less useful programming techniques:
 #
 # * default assignment using the ?= assignment operator
-# * including the same file recursively
+# * including the same file recursively (rather unusual)
 # * extracting the current value of a variable using the .for loop
 # * using shell commands for calculations since make is a text processor
 # * using the :: dependency operator for adding commands to a target
diff -r 1ebb120f11dc -r 82073add6128 usr.bin/make/unit-tests/opt-debug-parse.exp
--- a/usr.bin/make/unit-tests/opt-debug-parse.exp       Sat Jan 08 21:28:59 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-parse.exp       Sat Jan 08 22:13:43 2022 +0000
@@ -5,6 +5,12 @@
        in .include from opt-debug-parse.mk:18
 ParseEOF: returning to file opt-debug-parse.mk, line 18
 SetFilenameVars: ${.PARSEDIR} = `<curdir>' ${.PARSEFILE} = `opt-debug-parse.mk'
-Parsing line 22: .MAKEFLAGS: -d0
+Parsing line 23: .include "/dev/null"
+Parse_PushInput: file /dev/null, line 1
+SetFilenameVars: ${.PARSEDIR} = `/dev' ${.PARSEFILE} = `null'
+SetFilenameVars: ${.INCLUDEDFROMDIR} = `<curdir>' ${.INCLUDEDFROMFILE} = `opt-debug-parse.mk'
+ParseEOF: returning to file opt-debug-parse.mk, line 23
+SetFilenameVars: ${.PARSEDIR} = `<curdir>' ${.PARSEFILE} = `opt-debug-parse.mk'
+Parsing line 25: .MAKEFLAGS: -d0
 ParseDependency(.MAKEFLAGS: -d0)
 exit status 0
diff -r 1ebb120f11dc -r 82073add6128 usr.bin/make/unit-tests/opt-debug-parse.mk
--- a/usr.bin/make/unit-tests/opt-debug-parse.mk        Sat Jan 08 21:28:59 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-parse.mk        Sat Jan 08 22:13:43 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: opt-debug-parse.mk,v 1.2 2022/01/02 03:23:55 rillig Exp $
+# $NetBSD: opt-debug-parse.mk,v 1.3 2022/01/08 22:13:43 rillig Exp $
 #
 # Tests for the -dp command line option, which adds debug logging about
 # makefile parsing.
@@ -16,9 +16,12 @@
     value
 .info trace with multi-line .for loop head
 .endfor
-# FIXME: The .exp file says 'in .include from opt-debug-parse.mk:18', which is
+# FIXME: The .exp file says 'in .include from opt-debug-parse.mk:19', which is
 # completely wrong.  It should rather say 'in .for loop from :13'.
 
+# XXX: The debug log should return to "line 24" instead of "line 23".
+.include "/dev/null"
+
 .MAKEFLAGS: -d0
 
 all: .PHONY



Home | Main Index | Thread Index | Old Index