Module Name: src
Committed By: rillig
Date: Sun Aug 23 14:46:33 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: Makefile sh-leading-plus.exp
sh-leading-plus.mk
Log Message:
make(1): add test for + commands with the -n command line option
To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/sh-leading-plus.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/sh-leading-plus.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.118 src/usr.bin/make/unit-tests/Makefile:1.119
--- src/usr.bin/make/unit-tests/Makefile:1.118 Sun Aug 23 14:28:04 2020
+++ src/usr.bin/make/unit-tests/Makefile Sun Aug 23 14:46:33 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.118 2020/08/23 14:28:04 rillig Exp $
+# $NetBSD: Makefile,v 1.119 2020/08/23 14:46:33 rillig Exp $
#
# Unit tests for make(1)
#
@@ -334,6 +334,7 @@ FLAGS.opt-var-literal= -V VAR -V VALUE
FLAGS.opt-warnings-as-errors= -W
FLAGS.order= -j1
FLAGS.recursive= -dL
+FLAGS.sh-leading-plus= -n
FLAGS.vardebug= -k -dv FROM_CMDLINE=
FLAGS.varmod-match-escape= -dv
FLAGS.varname-dot-shell= -dpv
Index: src/usr.bin/make/unit-tests/sh-leading-plus.exp
diff -u src/usr.bin/make/unit-tests/sh-leading-plus.exp:1.1 src/usr.bin/make/unit-tests/sh-leading-plus.exp:1.2
--- src/usr.bin/make/unit-tests/sh-leading-plus.exp:1.1 Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/sh-leading-plus.exp Sun Aug 23 14:46:33 2020
@@ -1 +1,4 @@
+echo 'this command is not run'
+echo 'this command is run'
+this command is run
exit status 0
Index: src/usr.bin/make/unit-tests/sh-leading-plus.mk
diff -u src/usr.bin/make/unit-tests/sh-leading-plus.mk:1.2 src/usr.bin/make/unit-tests/sh-leading-plus.mk:1.3
--- src/usr.bin/make/unit-tests/sh-leading-plus.mk:1.2 Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/sh-leading-plus.mk Sun Aug 23 14:46:33 2020
@@ -1,9 +1,8 @@
-# $NetBSD: sh-leading-plus.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: sh-leading-plus.mk,v 1.3 2020/08/23 14:46:33 rillig Exp $
#
# Tests for shell commands preceded by a '+', to run them even if
# the command line option -n is given.
-# TODO: Implementation
-
all:
- @:;
+ @echo 'this command is not run'
+ @+echo 'this command is run'