Module Name:    src
Committed By:   apb
Date:           Wed Aug 20 08:39:14 UTC 2014

Modified Files:
        src/usr.bin/make/unit-tests: Makefile test.exp
Added Files:
        src/usr.bin/make/unit-tests: varshell

Log Message:
Add tests for VAR != command.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/make/unit-tests/test.exp
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/varshell

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.38 src/usr.bin/make/unit-tests/Makefile:1.39
--- src/usr.bin/make/unit-tests/Makefile:1.38	Wed Aug 28 21:56:50 2013
+++ src/usr.bin/make/unit-tests/Makefile	Wed Aug 20 08:39:14 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.38 2013/08/28 21:56:50 sjg Exp $
+# $NetBSD: Makefile,v 1.39 2014/08/20 08:39:14 apb Exp $
 #
 # Unit tests for make(1)
 # The main targets are:
@@ -46,7 +46,8 @@ SUBFILES= \
 	ternary \
 	unexport \
 	unexport-env \
-	varcmd
+	varcmd \
+	varshell
 
 all: ${SUBFILES}
 

Index: src/usr.bin/make/unit-tests/test.exp
diff -u src/usr.bin/make/unit-tests/test.exp:1.43 src/usr.bin/make/unit-tests/test.exp:1.44
--- src/usr.bin/make/unit-tests/test.exp:1.43	Wed Aug 28 21:56:50 2013
+++ src/usr.bin/make/unit-tests/test.exp	Wed Aug 20 08:39:14 2014
@@ -379,5 +379,16 @@ five FU=<v>bar</v> FOO=<v>goo</v> VAR=<v
 five v=is x k=is x
 six v=is y k=is y
 show-v v=override k=override
+sh: /bin/no/such/command: not found
+make: "varshell" line 5: warning: "/bin/no/such/command" returned non-zero status
+make: "varshell" line 6: warning: "kill -ALRM $$" exited on a signal
+make: "varshell" line 7: warning: "false" returned non-zero status
+make: "varshell" line 8: warning: "echo "output before the error"; false" returned non-zero status
+EXEC_FAILED=''
+TERMINATED_BY_SIGNAL=''
+ERROR_NO_OUTPUT=''
+ERROR_WITH_OUTPUT='output before the error'
+NO_ERROR_NO_OUTPUT=''
+NO_ERROR_WITH_OUTPUT='this is good'
 *** Error code 1 (ignored)
 *** Error code 1 (ignored)

Added files:

Index: src/usr.bin/make/unit-tests/varshell
diff -u /dev/null src/usr.bin/make/unit-tests/varshell:1.1
--- /dev/null	Wed Aug 20 08:39:14 2014
+++ src/usr.bin/make/unit-tests/varshell	Wed Aug 20 08:39:14 2014
@@ -0,0 +1,18 @@
+# $Id: varshell,v 1.1 2014/08/20 08:39:14 apb Exp $
+#
+# Test VAR != shell command
+
+EXEC_FAILED		!= /bin/no/such/command
+TERMINATED_BY_SIGNAL	!= kill -ALRM $$$$
+ERROR_NO_OUTPUT		!= false
+ERROR_WITH_OUTPUT	!= echo "output before the error"; false
+NO_ERROR_NO_OUTPUT	!= true
+NO_ERROR_WITH_OUTPUT	!= echo "this is good"
+
+allvars= EXEC_FAILED TERMINATED_BY_SIGNAL ERROR_NO_OUTPUT ERROR_WITH_OUTPUT \
+	NO_ERROR_NO_OUTPUT NO_ERROR_WITH_OUTPUT
+
+all:
+.for v in ${allvars}
+	@echo ${v}=\'${${v}}\'
+.endfor

Reply via email to