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): demonstrate wrong line numb...
details: https://anonhg.NetBSD.org/src/rev/c8c579b464f2
branches: trunk
changeset: 957964:c8c579b464f2
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Dec 19 12:14:59 2020 +0000
description:
make(1): demonstrate wrong line numbers in .for loops, since 2007-01-01
diffstat:
distrib/sets/lists/tests/mi | 4 ++-
usr.bin/make/unit-tests/Makefile | 3 +-
usr.bin/make/unit-tests/directive-for-lines.exp | 10 +++++++++
usr.bin/make/unit-tests/directive-for-lines.mk | 26 +++++++++++++++++++++++++
4 files changed, 41 insertions(+), 2 deletions(-)
diffs (79 lines):
diff -r 6a6b2aaecee9 -r c8c579b464f2 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Sat Dec 19 10:57:17 2020 +0000
+++ b/distrib/sets/lists/tests/mi Sat Dec 19 12:14:59 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.994 2020/12/14 20:23:49 rillig Exp $
+# $NetBSD: mi,v 1.995 2020/12/19 12:14:59 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -5054,6 +5054,8 @@
./usr/tests/usr.bin/make/unit-tests/directive-export.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/directive-for-generating-endif.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/directive-for-generating-endif.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/directive-for-lines.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/directive-for-lines.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/directive-for.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/directive-for.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/directive-hyphen-include.exp tests-usr.bin-tests compattestfile,atf
diff -r 6a6b2aaecee9 -r c8c579b464f2 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Sat Dec 19 10:57:17 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile Sat Dec 19 12:14:59 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.250 2020/12/14 20:23:50 rillig Exp $
+# $NetBSD: Makefile,v 1.251 2020/12/19 12:14:59 rillig Exp $
#
# Unit tests for make(1)
#
@@ -159,6 +159,7 @@
TESTS+= directive-export-literal
TESTS+= directive-for
TESTS+= directive-for-generating-endif
+TESTS+= directive-for-lines
TESTS+= directive-hyphen-include
TESTS+= directive-if
TESTS+= directive-if-nested
diff -r 6a6b2aaecee9 -r c8c579b464f2 usr.bin/make/unit-tests/directive-for-lines.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/directive-for-lines.exp Sat Dec 19 12:14:59 2020 +0000
@@ -0,0 +1,10 @@
+make: "directive-for-lines.mk" line 12: expect 18
+make: "directive-for-lines.mk" line 12: expect 18
+make: "directive-for-lines.mk" line 14: expect 24
+make: "directive-for-lines.mk" line 12: expect 18
+make: "directive-for-lines.mk" line 12: expect 18
+make: "directive-for-lines.mk" line 14: expect 24
+make: no target to make.
+
+make: stopped in unit-tests
+exit status 2
diff -r 6a6b2aaecee9 -r c8c579b464f2 usr.bin/make/unit-tests/directive-for-lines.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/directive-for-lines.mk Sat Dec 19 12:14:59 2020 +0000
@@ -0,0 +1,26 @@
+# $NetBSD: directive-for-lines.mk,v 1.1 2020/12/19 12:14:59 rillig Exp $
+#
+# Tests for the line numbers that are reported in .for loops.
+#
+# Since 2007-01-01 21:47:32 (git 4d3c468f96e1080e4d3cca8cc39067a73af14fbb),
+# parse.c 1.127, the line numbers for the .info directives and error messages
+# inside .for loops have been wrong since ParseGetLine skips empty lines, even
+# when collecting the lines for the .for loop body.
+
+.for outer in a b
+
+# comment
+
+.for inner in 1 2
+
+# comment
+
+.info expect 18
+
+.endfor
+
+# comment
+
+.info expect 24
+
+.endfor
Home |
Main Index |
Thread Index |
Old Index