Module Name: src
Committed By: rillig
Date: Sat Oct 3 14:39:36 UTC 2020
Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: shell-csh.exp shell-csh.mk
shell-custom.exp shell-custom.mk shell-ksh.exp shell-ksh.mk
shell-sh.exp shell-sh.mk
Log Message:
make(1): add tests for the various supported shells
To generate a diff of this commit:
cvs rdiff -u -r1.935 -r1.936 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.157 -r1.158 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/shell-csh.exp \
src/usr.bin/make/unit-tests/shell-csh.mk \
src/usr.bin/make/unit-tests/shell-custom.exp \
src/usr.bin/make/unit-tests/shell-custom.mk \
src/usr.bin/make/unit-tests/shell-ksh.exp \
src/usr.bin/make/unit-tests/shell-ksh.mk \
src/usr.bin/make/unit-tests/shell-sh.exp \
src/usr.bin/make/unit-tests/shell-sh.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.935 src/distrib/sets/lists/tests/mi:1.936
--- src/distrib/sets/lists/tests/mi:1.935 Fri Oct 2 20:34:59 2020
+++ src/distrib/sets/lists/tests/mi Sat Oct 3 14:39:36 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.935 2020/10/02 20:34:59 rillig Exp $
+# $NetBSD: mi,v 1.936 2020/10/03 14:39:36 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -4973,6 +4973,14 @@
./usr/tests/usr.bin/make/unit-tests/sh-single-line.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/sh.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/sh.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/shell-csh.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/shell-csh.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/shell-custom.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/shell-custom.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/shell-ksh.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/shell-ksh.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/shell-sh.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/shell-sh.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/suff-rebuild.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/suff-rebuild.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/suffixes.exp tests-usr.bin-tests compattestfile,atf
Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.157 src/usr.bin/make/unit-tests/Makefile:1.158
--- src/usr.bin/make/unit-tests/Makefile:1.157 Sat Oct 3 08:16:53 2020
+++ src/usr.bin/make/unit-tests/Makefile Sat Oct 3 14:39:36 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.157 2020/10/03 08:16:53 rillig Exp $
+# $NetBSD: Makefile,v 1.158 2020/10/03 14:39:36 rillig Exp $
#
# Unit tests for make(1)
#
@@ -244,6 +244,10 @@ TESTS+= sh-leading-plus
TESTS+= sh-meta-chars
TESTS+= sh-multi-line
TESTS+= sh-single-line
+TESTS+= shell-csh
+TESTS+= shell-custom
+TESTS+= shell-ksh
+TESTS+= shell-sh
TESTS+= # suffixes # runs into an endless loop (try -dA)
TESTS+= suff-rebuild
TESTS+= sunshcmd
Added files:
Index: src/usr.bin/make/unit-tests/shell-csh.exp
diff -u /dev/null src/usr.bin/make/unit-tests/shell-csh.exp:1.1
--- /dev/null Sat Oct 3 14:39:36 2020
+++ src/usr.bin/make/unit-tests/shell-csh.exp Sat Oct 3 14:39:36 2020
@@ -0,0 +1,4 @@
+true normal
+true always
+true ignore errors
+exit status 0
Index: src/usr.bin/make/unit-tests/shell-csh.mk
diff -u /dev/null src/usr.bin/make/unit-tests/shell-csh.mk:1.1
--- /dev/null Sat Oct 3 14:39:36 2020
+++ src/usr.bin/make/unit-tests/shell-csh.mk Sat Oct 3 14:39:36 2020
@@ -0,0 +1,13 @@
+# $NetBSD: shell-csh.mk,v 1.1 2020/10/03 14:39:36 rillig Exp $
+#
+# Tests for using a C shell for running the commands.
+
+.SHELL: name="csh" path="csh"
+
+# Contrary to sh and ksh, the csh does not know the ':' command.
+# Therefore this test uses 'true' instead.
+all:
+ true normal
+ @true hidden
+ +true always
+ -true ignore errors
Index: src/usr.bin/make/unit-tests/shell-custom.exp
diff -u /dev/null src/usr.bin/make/unit-tests/shell-custom.exp:1.1
--- /dev/null Sat Oct 3 14:39:36 2020
+++ src/usr.bin/make/unit-tests/shell-custom.exp Sat Oct 3 14:39:36 2020
@@ -0,0 +1,8 @@
+: normal
+-c : normal
+-c : hidden
+: always
+-c : always
+: ignore errors
+-c : ignore errors
+exit status 0
Index: src/usr.bin/make/unit-tests/shell-custom.mk
diff -u /dev/null src/usr.bin/make/unit-tests/shell-custom.mk:1.1
--- /dev/null Sat Oct 3 14:39:36 2020
+++ src/usr.bin/make/unit-tests/shell-custom.mk Sat Oct 3 14:39:36 2020
@@ -0,0 +1,14 @@
+# $NetBSD: shell-custom.mk,v 1.1 2020/10/03 14:39:36 rillig Exp $
+#
+# Tests for using a custom shell for running the commands.
+
+.SHELL: name="sh" path="echo"
+# TODO: demonstrate the other shell features as well:
+# - error control
+# - output control
+
+all:
+ : normal
+ @: hidden
+ +: always
+ -: ignore errors
Index: src/usr.bin/make/unit-tests/shell-ksh.exp
diff -u /dev/null src/usr.bin/make/unit-tests/shell-ksh.exp:1.1
--- /dev/null Sat Oct 3 14:39:36 2020
+++ src/usr.bin/make/unit-tests/shell-ksh.exp Sat Oct 3 14:39:36 2020
@@ -0,0 +1,4 @@
+: normal
+: always
+: ignore errors
+exit status 0
Index: src/usr.bin/make/unit-tests/shell-ksh.mk
diff -u /dev/null src/usr.bin/make/unit-tests/shell-ksh.mk:1.1
--- /dev/null Sat Oct 3 14:39:36 2020
+++ src/usr.bin/make/unit-tests/shell-ksh.mk Sat Oct 3 14:39:36 2020
@@ -0,0 +1,11 @@
+# $NetBSD: shell-ksh.mk,v 1.1 2020/10/03 14:39:36 rillig Exp $
+#
+# Tests for using a korn shell for running the commands.
+
+.SHELL: name="ksh" path="ksh"
+
+all:
+ : normal
+ @: hidden
+ +: always
+ -: ignore errors
Index: src/usr.bin/make/unit-tests/shell-sh.exp
diff -u /dev/null src/usr.bin/make/unit-tests/shell-sh.exp:1.1
--- /dev/null Sat Oct 3 14:39:36 2020
+++ src/usr.bin/make/unit-tests/shell-sh.exp Sat Oct 3 14:39:36 2020
@@ -0,0 +1,4 @@
+: normal
+: always
+: ignore errors
+exit status 0
Index: src/usr.bin/make/unit-tests/shell-sh.mk
diff -u /dev/null src/usr.bin/make/unit-tests/shell-sh.mk:1.1
--- /dev/null Sat Oct 3 14:39:36 2020
+++ src/usr.bin/make/unit-tests/shell-sh.mk Sat Oct 3 14:39:36 2020
@@ -0,0 +1,12 @@
+# $NetBSD: shell-sh.mk,v 1.1 2020/10/03 14:39:36 rillig Exp $
+#
+# Tests for using a bourne shell for running the commands.
+# This is the default shell, so there's nothing surprising.
+
+.SHELL: name="sh" path="sh"
+
+all:
+ : normal
+ @: hidden
+ +: always
+ -: ignore errors