summaryrefslogtreecommitdiff
path: root/regress/tools/Makefile
blob: 207a6132dc5411f67bc6def005bf664da3c86f83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# $NetBSD: Makefile,v 1.18 2021/05/24 19:53:50 wiz Exp $
#

PKGNAME=	regress-tools-2020.05.02
PKGREVISION=	1
CATEGORIES=	pkgtools
DISTFILES=	# none

MAINTAINER=	pkgsrc-users@NetBSD.org
COMMENT=	Ensure that the tools wrapper works as expected
LICENSE=	2-clause-bsd

WRKSRC=		${WRKDIR}
PLIST_SRC=	# none
REGRESS_TESTS+=	logging shquote

TOOLS_CREATE+=	script-dquot
TOOLS_SCRIPT.script-dquot= \
		echo "hello; world"

TOOLS_CREATE+=	script-backslash
TOOLS_SCRIPT.script-backslash= \
		echo hello\;\ world

# If both of the above tools are properly quoted during logging, the
# semicolon in "hello; world" is never interpreted as a shell command
# delimiter, and this tool is never run.
TOOLS_CREATE+=	world
TOOLS_SCRIPT.world= \
		echo oops

# The script for this example tool contains single quotes, double quotes
# and backslashes to demonstrate that these are properly logged.
TOOLS_CREATE+=	for-loop
TOOLS_SCRIPT.for-loop= \
	printf '%s' "$$0"; \
	for arg in "$$@"; do \
		printf ' <%s>' "$$arg"; \
	done; \
	printf '\n'

# Demonstrates that double quotes in both the TOOLS_ARGS and the actual
# arguments are properly logged.
TOOLS_CREATE+=			path-args-dquot
TOOLS_PATH.path-args-dquot=	echo
TOOLS_ARGS.path-args-dquot=	\" "\"" '"'

# Demonstrates that both the TOOLS_ARGS and the actual arguments are
# properly logged.
TOOLS_CREATE+=		path-args
TOOLS_PATH.path-args=	echo
TOOLS_ARGS.path-args=	" \"'\\$$" "*"

do-build:
.for test in ${REGRESS_TESTS}
	@${ECHO_MSG} "Running testsuite "${test:Q}
	${RUN} cd ${WRKSRC} \
	&& PKGSRCDIR=${PKGSRCDIR} ${SH} ${FILESDIR}/${test:Q}-test.sh
.endfor

.include "../../mk/bsd.pkg.mk"