From cdbdfe238406ac08c43885de1e6e3a51fdd3cde6 Mon Sep 17 00:00:00 2001 From: rillig Date: Sat, 1 Jun 2024 10:06:23 +0000 Subject: [PATCH] tests/make: require all expected messages to be listed in the .mk files --- usr.bin/make/unit-tests/Makefile | 7 ++++++- usr.bin/make/unit-tests/directive-export.exp | 8 ++++---- usr.bin/make/unit-tests/directive-export.mk | 9 ++++++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile index 93b3f8226dda..a685f8e13d33 100644 --- a/usr.bin/make/unit-tests/Makefile +++ b/usr.bin/make/unit-tests/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.345 2024/05/24 23:02:46 rillig Exp $ +# $NetBSD: Makefile,v 1.346 2024/06/01 10:06:23 rillig Exp $ # # Unit tests for make(1) # @@ -773,6 +773,11 @@ test: ${OUTFILES} .PHONY echo "Failed tests: $${failed}" ; false ; \ else \ echo "All tests passed" ; \ + lua=${LUA:Ulua} ; \ + have_lua=$$("$$lua" -e 'print "yes"' 2>&1) ; \ + if [ "$$have_lua" = "yes" ]; then \ + "$$lua" ./check-expect.lua *.mk; \ + fi; \ fi accept: diff --git a/usr.bin/make/unit-tests/directive-export.exp b/usr.bin/make/unit-tests/directive-export.exp index d8c9b2308668..02271508cf42 100644 --- a/usr.bin/make/unit-tests/directive-export.exp +++ b/usr.bin/make/unit-tests/directive-export.exp @@ -1,5 +1,5 @@ -make: "directive-export.mk" line 33: warning: .export requires an argument. -make: "directive-export.mk" line 57: 00:00:00 -make: "directive-export.mk" line 62: 00:00:00 -make: "directive-export.mk" line 65: 16:00:00 +make: "directive-export.mk" line 36: warning: .export requires an argument. +make: "directive-export.mk" line 60: 00:00:00 +make: "directive-export.mk" line 65: 00:00:00 +make: "directive-export.mk" line 68: 16:00:00 exit status 0 diff --git a/usr.bin/make/unit-tests/directive-export.mk b/usr.bin/make/unit-tests/directive-export.mk index 6ccb5be47c9e..d2ed7a1a1efb 100644 --- a/usr.bin/make/unit-tests/directive-export.mk +++ b/usr.bin/make/unit-tests/directive-export.mk @@ -1,4 +1,4 @@ -# $NetBSD: directive-export.mk,v 1.11 2024/06/01 06:26:36 sjg Exp $ +# $NetBSD: directive-export.mk,v 1.12 2024/06/01 10:06:23 rillig Exp $ # # Tests for the .export directive. # @@ -28,8 +28,11 @@ VAR= value $$ ${INDIRECT} . error .endif -# No syntactical argument used to mean export all variables. -# Since var.c 1.1117 2024/06/01 it causes a warning. +# Before var.c 1.1117 from 2024-06-01, a plain ".export" without a syntactical +# argument exported all global variables. This case could be triggered +# unintentionally by writing a line of the form ".export ${VARNAMES}" to a +# makefile, when VARNAMES was an empty list. +# expect+1: warning: .export requires an argument. .export # An empty argument means no additional variables to export.