| @@ -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 | |
10 | DISTNAME= make-shell-2020.05.01 | | 10 | DISTNAME= make-shell-2020.05.01 |
11 | CATEGORIES= regress | | 11 | CATEGORIES= regress |
12 | MASTER_SITES= # none | | 12 | MASTER_SITES= # none |
13 | DISTFILES= # none | | 13 | DISTFILES= # none |
14 | | | 14 | |
15 | MAINTAINER= pkgsrc-users@NetBSD.org | | 15 | MAINTAINER= pkgsrc-users@NetBSD.org |
16 | COMMENT= Test features of the shell used by bmake | | 16 | COMMENT= Test features of the shell used by bmake |
| | | 17 | LICENSE= 2-clause-bsd |
17 | | | 18 | |
18 | WRKSRC= ${WRKDIR} | | 19 | WRKSRC= ${WRKDIR} |
19 | PLIST_SRC= # none | | 20 | PLIST_SRC= # none |
20 | | | 21 | |
21 | do-regress: | | 22 | do-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" |