Module Name:    src
Committed By:   rillig
Date:           Sat Jun  1 10:06:23 UTC 2024

Modified Files:
        src/usr.bin/make/unit-tests: Makefile directive-export.exp
            directive-export.mk

Log Message:
tests/make: require all expected messages to be listed in the .mk files


To generate a diff of this commit:
cvs rdiff -u -r1.345 -r1.346 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/directive-export.exp
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/directive-export.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/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.345 src/usr.bin/make/unit-tests/Makefile:1.346
--- src/usr.bin/make/unit-tests/Makefile:1.345	Fri May 24 23:02:46 2024
+++ src/usr.bin/make/unit-tests/Makefile	Sat Jun  1 10:06:23 2024
@@ -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:

Index: src/usr.bin/make/unit-tests/directive-export.exp
diff -u src/usr.bin/make/unit-tests/directive-export.exp:1.7 src/usr.bin/make/unit-tests/directive-export.exp:1.8
--- src/usr.bin/make/unit-tests/directive-export.exp:1.7	Sat Jun  1 06:26:36 2024
+++ src/usr.bin/make/unit-tests/directive-export.exp	Sat Jun  1 10:06:23 2024
@@ -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

Index: src/usr.bin/make/unit-tests/directive-export.mk
diff -u src/usr.bin/make/unit-tests/directive-export.mk:1.11 src/usr.bin/make/unit-tests/directive-export.mk:1.12
--- src/usr.bin/make/unit-tests/directive-export.mk:1.11	Sat Jun  1 06:26:36 2024
+++ src/usr.bin/make/unit-tests/directive-export.mk	Sat Jun  1 10:06:23 2024
@@ -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.

Reply via email to