summaryrefslogtreecommitdiff
path: root/regress/make-shell
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-05-01 19:16:47 +0000
committerrillig <rillig@pkgsrc.org>2020-05-01 19:16:47 +0000
commite21f6abdca8705f7303ba3958d49a1a1ec849707 (patch)
treee85372d521e61db60377e8e6bbcace0fa9981c14 /regress/make-shell
parent9d0fafe6fc00227153d32328ae53eae0c763f62c (diff)
downloadpkgsrc-e21f6abdca8705f7303ba3958d49a1a1ec849707.tar.gz
regress/make-shell: regression test for the shell used by devel/bmake
Diffstat (limited to 'regress/make-shell')
-rw-r--r--regress/make-shell/Makefile32
-rw-r--r--regress/make-shell/spec15
2 files changed, 47 insertions, 0 deletions
diff --git a/regress/make-shell/Makefile b/regress/make-shell/Makefile
new file mode 100644
index 00000000000..c68c142f0f6
--- /dev/null
+++ b/regress/make-shell/Makefile
@@ -0,0 +1,32 @@
+# $NetBSD: Makefile,v 1.1 2020/05/01 19:16:47 rillig Exp $
+#
+# This regression test demonstrates which features are supported by the
+# shell that is used internally by devel/bmake. That shell may be
+# different from /bin/sh and ${SH} and TOOLS_PLATFORM.sh.
+#
+# This is most interesting for platforms whose /bin/sh is so broken that
+# it is basically unusable, such as SunOS 10 and earlier.
+
+DISTNAME= make-shell-2020.05.01
+CATEGORIES= regress
+MASTER_SITES= # none
+DISTFILES= # none
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+COMMENT= Test features of the shell used by bmake
+
+WRKSRC= ${WRKDIR}
+PLIST_SRC= # none
+
+do-regress:
+ # Up to May 2020, shell functions were not used in package
+ # Makefiles. But could they?
+ ${RUN} func() { :; }; func
+
+ # The Solaris /bin/sh cannot handle these word expansions.
+ # Therefore on Solaris, bmake uses /usr/xpg4/bin/sh instead.
+ # Make sure that these don't produce a syntax error.
+ ${RUN} path="1/2/3/4"; one=$${path%%/*}
+ ${RUN} path="1/2/3/4"; four=$${path##*/}
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/regress/make-shell/spec b/regress/make-shell/spec
new file mode 100644
index 00000000000..e25124b2506
--- /dev/null
+++ b/regress/make-shell/spec
@@ -0,0 +1,15 @@
+# $NetBSD: spec,v 1.1 2020/05/01 19:16:47 rillig Exp $
+#
+
+do_test() {
+ $TEST_MAKE do-regress 1> "$TEST_OUTFILE" 2>&1 \
+ || TEST_EXITSTATUS=$?
+}
+
+do_cleanup() {
+ $TEST_MAKE clean
+}
+
+check_result() {
+ exit_status 0
+}