Module Name:    src
Committed By:   rillig
Date:           Sat Jan  8 22:13:44 UTC 2022

Modified Files:
        src/usr.bin/make/unit-tests: hanoi-include.mk opt-debug-parse.exp
            opt-debug-parse.mk

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


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/hanoi-include.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/opt-debug-parse.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-debug-parse.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/hanoi-include.mk
diff -u src/usr.bin/make/unit-tests/hanoi-include.mk:1.1 src/usr.bin/make/unit-tests/hanoi-include.mk:1.2
--- src/usr.bin/make/unit-tests/hanoi-include.mk:1.1	Sat Oct  3 17:30:54 2020
+++ src/usr.bin/make/unit-tests/hanoi-include.mk	Sat Jan  8 22:13:43 2022
@@ -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

Index: src/usr.bin/make/unit-tests/opt-debug-parse.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-parse.exp:1.3 src/usr.bin/make/unit-tests/opt-debug-parse.exp:1.4
--- src/usr.bin/make/unit-tests/opt-debug-parse.exp:1.3	Sat Jan  8 20:21:34 2022
+++ src/usr.bin/make/unit-tests/opt-debug-parse.exp	Sat Jan  8 22:13:43 2022
@@ -5,6 +5,12 @@ make: "opt-debug-parse.mk" line 17: trac
 	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

Index: src/usr.bin/make/unit-tests/opt-debug-parse.mk
diff -u src/usr.bin/make/unit-tests/opt-debug-parse.mk:1.2 src/usr.bin/make/unit-tests/opt-debug-parse.mk:1.3
--- src/usr.bin/make/unit-tests/opt-debug-parse.mk:1.2	Sun Jan  2 03:23:55 2022
+++ src/usr.bin/make/unit-tests/opt-debug-parse.mk	Sat Jan  8 22:13:43 2022
@@ -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

Reply via email to