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 Add tests for VAR != command.
details: https://anonhg.NetBSD.org/src/rev/8fd43d8e56be
branches: trunk
changeset: 331699:8fd43d8e56be
user: apb <apb%NetBSD.org@localhost>
date: Wed Aug 20 08:39:14 2014 +0000
description:
Add tests for VAR != command.
diffstat:
usr.bin/make/unit-tests/Makefile | 5 +++--
usr.bin/make/unit-tests/test.exp | 11 +++++++++++
usr.bin/make/unit-tests/varshell | 18 ++++++++++++++++++
3 files changed, 32 insertions(+), 2 deletions(-)
diffs (61 lines):
diff -r 70f6db276eba -r 8fd43d8e56be usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Wed Aug 20 08:37:25 2014 +0000
+++ b/usr.bin/make/unit-tests/Makefile Wed Aug 20 08:39:14 2014 +0000
@@ -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 @@
ternary \
unexport \
unexport-env \
- varcmd
+ varcmd \
+ varshell
all: ${SUBFILES}
diff -r 70f6db276eba -r 8fd43d8e56be usr.bin/make/unit-tests/test.exp
--- a/usr.bin/make/unit-tests/test.exp Wed Aug 20 08:37:25 2014 +0000
+++ b/usr.bin/make/unit-tests/test.exp Wed Aug 20 08:39:14 2014 +0000
@@ -379,5 +379,16 @@
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)
diff -r 70f6db276eba -r 8fd43d8e56be usr.bin/make/unit-tests/varshell
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/varshell Wed Aug 20 08:39:14 2014 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index