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 make(1): add tests for the various s...
details: https://anonhg.NetBSD.org/src/rev/4eab8472c027
branches: trunk
changeset: 1014795:4eab8472c027
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Oct 03 14:39:36 2020 +0000
description:
make(1): add tests for the various supported shells
diffstat:
distrib/sets/lists/tests/mi | 10 +++++++++-
usr.bin/make/unit-tests/Makefile | 6 +++++-
usr.bin/make/unit-tests/shell-csh.exp | 4 ++++
usr.bin/make/unit-tests/shell-csh.mk | 13 +++++++++++++
usr.bin/make/unit-tests/shell-custom.exp | 8 ++++++++
usr.bin/make/unit-tests/shell-custom.mk | 14 ++++++++++++++
usr.bin/make/unit-tests/shell-ksh.exp | 4 ++++
usr.bin/make/unit-tests/shell-ksh.mk | 11 +++++++++++
usr.bin/make/unit-tests/shell-sh.exp | 4 ++++
usr.bin/make/unit-tests/shell-sh.mk | 12 ++++++++++++
10 files changed, 84 insertions(+), 2 deletions(-)
diffs (146 lines):
diff -r c7ee43be2b27 -r 4eab8472c027 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Sat Oct 03 14:01:16 2020 +0000
+++ b/distrib/sets/lists/tests/mi Sat Oct 03 14:39:36 2020 +0000
@@ -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
diff -r c7ee43be2b27 -r 4eab8472c027 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Sat Oct 03 14:01:16 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile Sat Oct 03 14:39:36 2020 +0000
@@ -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-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
diff -r c7ee43be2b27 -r 4eab8472c027 usr.bin/make/unit-tests/shell-csh.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/shell-csh.exp Sat Oct 03 14:39:36 2020 +0000
@@ -0,0 +1,4 @@
+true normal
+true always
+true ignore errors
+exit status 0
diff -r c7ee43be2b27 -r 4eab8472c027 usr.bin/make/unit-tests/shell-csh.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/shell-csh.mk Sat Oct 03 14:39:36 2020 +0000
@@ -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
diff -r c7ee43be2b27 -r 4eab8472c027 usr.bin/make/unit-tests/shell-custom.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/shell-custom.exp Sat Oct 03 14:39:36 2020 +0000
@@ -0,0 +1,8 @@
+: normal
+-c : normal
+-c : hidden
+: always
+-c : always
+: ignore errors
+-c : ignore errors
+exit status 0
diff -r c7ee43be2b27 -r 4eab8472c027 usr.bin/make/unit-tests/shell-custom.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/shell-custom.mk Sat Oct 03 14:39:36 2020 +0000
@@ -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
diff -r c7ee43be2b27 -r 4eab8472c027 usr.bin/make/unit-tests/shell-ksh.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/shell-ksh.exp Sat Oct 03 14:39:36 2020 +0000
@@ -0,0 +1,4 @@
+: normal
+: always
+: ignore errors
+exit status 0
diff -r c7ee43be2b27 -r 4eab8472c027 usr.bin/make/unit-tests/shell-ksh.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/shell-ksh.mk Sat Oct 03 14:39:36 2020 +0000
@@ -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
diff -r c7ee43be2b27 -r 4eab8472c027 usr.bin/make/unit-tests/shell-sh.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/shell-sh.exp Sat Oct 03 14:39:36 2020 +0000
@@ -0,0 +1,4 @@
+: normal
+: always
+: ignore errors
+exit status 0
diff -r c7ee43be2b27 -r 4eab8472c027 usr.bin/make/unit-tests/shell-sh.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/shell-sh.mk Sat Oct 03 14:39:36 2020 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index