Fri May 1 19:40:27 2020 UTC ()
regress/make-shell: reuse the shell tests from the platform tests


(rillig)
diff -r1.2 -r1.3 pkgsrc/regress/make-shell/Makefile
diff -r1.1 -r1.2 pkgsrc/regress/make-shell/spec

cvs diff -r1.2 -r1.3 pkgsrc/regress/make-shell/Makefile (expand / switch to unified diff)

--- pkgsrc/regress/make-shell/Makefile 2020/05/01 19:28:15 1.2
+++ pkgsrc/regress/make-shell/Makefile 2020/05/01 19:40:27 1.3
@@ -1,41 +1,50 @@ @@ -1,41 +1,50 @@
1# $NetBSD: Makefile,v 1.2 2020/05/01 19:28:15 rillig Exp $ 1# $NetBSD: Makefile,v 1.3 2020/05/01 19:40:27 rillig Exp $
2# 2#
3# This regression test demonstrates which features are supported by the 3# This regression test demonstrates which features are supported by the
4# shell that is used internally by devel/bmake. That shell may be 4# shell that is used internally by devel/bmake. That shell may be
5# different from /bin/sh and ${SH} and TOOLS_PLATFORM.sh. 5# different from /bin/sh and ${SH} and TOOLS_PLATFORM.sh.
6# 6#
7# This is most interesting for platforms whose /bin/sh is so broken that 7# This is most interesting for platforms whose /bin/sh is so broken that
8# it is basically unusable, such as SunOS 10 and earlier. 8# it is basically unusable, such as SunOS 10 and earlier.
9 9
10DISTNAME= make-shell-2020.05.01 10DISTNAME= make-shell-2020.05.01
11CATEGORIES= regress 11CATEGORIES= regress
12MASTER_SITES= # none 12MASTER_SITES= # none
13DISTFILES= # none 13DISTFILES= # none
14 14
15MAINTAINER= pkgsrc-users@NetBSD.org 15MAINTAINER= pkgsrc-users@NetBSD.org
16COMMENT= Test features of the shell used by bmake 16COMMENT= Test features of the shell used by bmake
 17LICENSE= 2-clause-bsd
17 18
18WRKSRC= ${WRKDIR} 19WRKSRC= ${WRKDIR}
19PLIST_SRC= # none 20PLIST_SRC= # none
20 21
21do-regress: 22do-build:
22 # Up to May 2020, shell functions were not used in package 23 # Up to May 2020, shell functions were not used in package
23 # Makefiles. But could they? 24 # Makefiles. But could they?
24 ${RUN} func() { :; }; func 25 ${RUN} func() { :; }; func
25 26
26 # The Solaris /bin/sh cannot handle these word expansions. 27 # The Solaris /bin/sh cannot handle these word expansions.
27 # Therefore on Solaris, bmake uses /usr/xpg4/bin/sh instead. 28 # Therefore on Solaris, bmake uses /usr/xpg4/bin/sh instead.
28 # Make sure that these don't produce a syntax error. 29 # Make sure that these don't produce a syntax error.
29 ${RUN} path="1/2/3/4"; one=$${path%%/*} 30 ${RUN} path="1/2/3/4"; one=$${path%%/*}
30 ${RUN} path="1/2/3/4"; four=$${path##*/} 31 ${RUN} path="1/2/3/4"; four=$${path##*/}
31 32
32 # The Solaris /bin/sh exits with an error in this situation, 33 # The Solaris /bin/sh exits with an error in this situation,
33 # even though there is an "if" around the "cd". 34 # even though there is an "if" around the "cd".
34 ${RUN} \ 35 ${RUN} \
35 if cd /bddc80cd-760f-46e7-955c-e767772d57f5 2>/dev/null; then \ 36 if cd /bddc80cd-760f-46e7-955c-e767772d57f5 2>/dev/null; then \
36 ${FAIL_MSG} "cd unexpectedly succeeded"; \ 37 ${FAIL_MSG} "cd unexpectedly succeeded"; \
37 else \ 38 else \
38 : "That's expected"; \ 39 : "That's expected"; \
39 fi 40 fi
40 41
 42 # Run the same tests as for ${SH}.
 43 # These tests assume that they run in a temporary directory
 44 # and that all platform tools can be called by their plain name.
 45 # If these tests fail because of missing tools, add these to
 46 # USE_TOOLS.
 47 ${RUN} cd ${WRKSRC}; \
 48 . "${PKGSRCDIR}/regress/tools-platform/sh.test"
 49
41.include "../../mk/bsd.pkg.mk" 50.include "../../mk/bsd.pkg.mk"

cvs diff -r1.1 -r1.2 pkgsrc/regress/make-shell/spec (expand / switch to unified diff)

--- pkgsrc/regress/make-shell/spec 2020/05/01 19:16:47 1.1
+++ pkgsrc/regress/make-shell/spec 2020/05/01 19:40:27 1.2
@@ -1,15 +1,14 @@ @@ -1,15 +1,14 @@
1# $NetBSD: spec,v 1.1 2020/05/01 19:16:47 rillig Exp $ 1# $NetBSD: spec,v 1.2 2020/05/01 19:40:27 rillig Exp $
2# 2#
3 3
4do_test() { 4do_test() {
5 $TEST_MAKE do-regress 1> "$TEST_OUTFILE" 2>&1 \ 5 $TEST_MAKE 1> "$TEST_OUTFILE" 2>&1 || TEST_EXITSTATUS=$?
6 || TEST_EXITSTATUS=$? 
7} 6}
8 7
9do_cleanup() { 8do_cleanup() {
10 $TEST_MAKE clean 9 $TEST_MAKE clean
11} 10}
12 11
13check_result() { 12check_result() {
14 exit_status 0 13 exit_status 0
15} 14}