1 # $NetBSD: Makefile,v 1.20 2010/03/21 16:29:43 wiz Exp $
3 # Run many buildlink transform tests in a single regression test to avoid
4 # having to keep creating the wrapper scripts over and over again.
6 DISTNAME= regress-buildlink-transform-0.0
11 MAINTAINER= pkgsrc-users@NetBSD.org
12 COMMENT= test buildlink wrapper transformation
14 .include "../../mk/bsd.prefs.mk"
19 # Remove GCC optimization options.
20 BUILDLINK_TRANSFORM+= rm:-O[0-9]*
23 .if ${LOCALBASE} != "/opt/schily"
24 BUILDLINK_TRANSFORM+= rmdir:/opt/schily
27 # Convert "-lreadline" into "-ledit -ltermcap -lm".
28 BUILDLINK_TRANSFORM+= l:readline:edit:termcap:m
30 REGRESS_ENV= PATH=${PATH}
31 REGRESS_ENV+= WRAPPER_DEBUG=yes
33 # Create a "regress" script in the wrapper directory that just echoes its
38 _WRAP_ALIASES.REGRESS= regress
41 @${RM} -f ${WRAPPER_BINDIR}/${REGRESS}
43 .PHONY: regress do-regress
45 regress: wrapper do-regress
47 FAILED_TESTS= ${WRKDIR}/failed
48 PASSED_TESTS= ${WRKDIR}/passed
51 @if [ -f ${FAILED_TESTS} ]; then \
53 ${CAT} ${FAILED_TESTS} | while read test; do \
62 @if [ -f "${FAILED_TESTS}" ]; then \
63 ${ECHO} `${CAT} ${FAILED_TESTS} | ${WC} -l`; \
69 @if [ -f "${PASSED_TESTS}" ]; then \
70 ${ECHO} `${CAT} ${PASSED_TESTS} | ${WC} -l`; \
75 TEST_RESULT= runtest=`${SETENV} ${REGRESS_ENV} regress $$test`; \
76 ${ECHO} "(${.TARGET}) saw: $$test"; \
77 ${ECHO} "(${.TARGET}) got: $$runtest"; \
78 ${ECHO} "(${.TARGET}) expected: $$expected"; \
81 ${ECHO} "(${.TARGET}) result: PASS"; \
82 ${ECHO} "${.TARGET}" >> ${PASSED_TESTS}; \
85 ${ECHO} "(${.TARGET}) result: FAIL"; \
86 ${ECHO} "${.TARGET}" >> ${FAILED_TESTS}; \
90 TEST_DIR= ${.CURDIR}/tests
92 # If RUNTESTS is defined, then just run those tests, otherwise run them all.
94 TEST_MAKEFILES= ${RUNTESTS:S/^/${TEST_DIR}\//:S/$/.mk/}
95 . for _mkfile_ in ${TEST_MAKEFILES}
96 . if exists(${_mkfile_})
97 . include "${_mkfile_}"
101 . include "tests/include-pkgdir-slashdot.mk"
102 . include "tests/include-pkgdir.mk"
103 . include "tests/include-pkgsubdir.mk"
104 . include "tests/include-usr-include-slashdot.mk"
105 . include "tests/include-usr-include-subdir.mk"
106 . include "tests/include-usr-include.mk"
107 . include "tests/lib-expand.mk"
108 . include "tests/libdir-pkgdir-slashdot.mk"
109 . include "tests/libdir-pkgdir.mk"
110 . include "tests/libdir-pkgsubdir.mk"
111 . include "tests/libdir-usr-lib-slashdot.mk"
112 . include "tests/libdir-usr-lib-subdir.mk"
113 . include "tests/libdir-usr-lib.mk"
114 . include "tests/libpath.mk"
115 . include "tests/libpath-in-define.mk"
116 . include "tests/no-abspath.mk"
117 . include "tests/preserve-option.mk"
118 . include "tests/quoted-arg.mk"
119 . include "tests/remove-dir.mk"
120 . include "tests/remove-option.mk"
121 . include "tests/repeated-arg.mk"
122 . include "tests/rpath-merge.mk"
123 . include "tests/rpath-pkgdir-slashdot.mk"
124 . include "tests/rpath-pkgdir.mk"
125 . include "tests/rpath-pkgsubdir.mk"
126 . include "tests/rpath-split.mk"
127 . include "tests/rpath-usr-lib-slashdot.mk"
128 . include "tests/rpath-usr-lib-subdir.mk"
129 . include "tests/rpath-usr-lib.mk"
130 . include "tests/libpath-shlib.mk"
131 . include "tests/libpath-shmod.mk"
134 .include "../../mk/bsd.pkg.mk"