xref: /freebsd/contrib/bmake/unit-tests/opt-debug-parse.mk (revision 1d3f2ddc32fc37e4835aa5a51eabc8696c1e8114)
1*1d3f2ddcSSimon J. Gerraty# $NetBSD: opt-debug-parse.mk,v 1.7 2022/02/09 21:09:24 rillig Exp $
2956e45f6SSimon J. Gerraty#
3956e45f6SSimon J. Gerraty# Tests for the -dp command line option, which adds debug logging about
4956e45f6SSimon J. Gerraty# makefile parsing.
5956e45f6SSimon J. Gerraty
69f45a3c8SSimon J. Gerraty.MAKEFLAGS: -dp
79f45a3c8SSimon J. Gerraty
8956e45f6SSimon J. Gerraty# TODO: Implementation
9956e45f6SSimon J. Gerraty
109f45a3c8SSimon J. Gerraty# Before parse.c 1.639 from 2022-01-08, PrintStackTrace and other diagnostics
119f45a3c8SSimon J. Gerraty# printed a wrong line number, using the last line before the loop body, while
129f45a3c8SSimon J. Gerraty# it should rather be the line number where the .for loop starts.
139f45a3c8SSimon J. Gerraty#
149f45a3c8SSimon J. Gerraty# Before parse.c 1.643 from 2022-01-08, PrintStackTrace tried to be too clever
159f45a3c8SSimon J. Gerraty# by merging stack trace entries, printing confusing line numbers as a result.
169f45a3c8SSimon J. Gerraty.for \
179f45a3c8SSimon J. Gerraty    var \
189f45a3c8SSimon J. Gerraty    in \
199f45a3c8SSimon J. Gerraty    value
209f45a3c8SSimon J. Gerraty.info trace with multi-line .for loop head
219f45a3c8SSimon J. Gerraty.endfor
229f45a3c8SSimon J. Gerraty
23*1d3f2ddcSSimon J. Gerraty# Before parse.c 1.641 from 2022-01-08, the debug log said it returned to
249f45a3c8SSimon J. Gerraty# the line of the '.include' instead of the line following it.
259f45a3c8SSimon J. Gerraty.include "/dev/null"
269f45a3c8SSimon J. Gerraty
279f45a3c8SSimon J. Gerraty
289f45a3c8SSimon J. Gerraty# In .for loops with multiple variables, the variable details are included in
299f45a3c8SSimon J. Gerraty# the stack trace, just as with a single variable.
309f45a3c8SSimon J. Gerraty.for a b c in 1 2 3 ${:U4 5 6}
319f45a3c8SSimon J. Gerraty.info trace
329f45a3c8SSimon J. Gerraty.endfor
339f45a3c8SSimon J. Gerraty
349f45a3c8SSimon J. Gerraty
359f45a3c8SSimon J. Gerraty.MAKEFLAGS: -d0
369f45a3c8SSimon J. Gerraty
379f45a3c8SSimon J. Gerratyall: .PHONY
38