1 # $NetBSD: Makefile,v 1.15 2005/06/08 05:49:21 jlam 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= jlam@NetBSD.org
12 COMMENT= test buildlink wrapper transformation
14 .include "../../mk/bsd.prefs.mk"
21 # Remove GCC optimization options.
22 BUILDLINK_TRANSFORM+= rm:-O[0-9]*
25 .if ${LOCALBASE} != "/opt/schily"
26 BUILDLINK_TRANSFORM+= rmdir:/opt/schily
29 # Convert "-lreadline" into "-ledit -ltermcap -lm".
30 BUILDLINK_TRANSFORM+= l:readline:edit:termcap:m
32 REGRESS_ENV= PATH=${PATH}
33 .if defined(PHASES_AFTER_WRAPPER)
34 REGRESS_ENV+= WRAPPER_DEBUG=yes
37 # Create a "regress" script in the wrapper directory that just echoes its
42 _WRAP_ALIASES.REGRESS= regress
45 @${RM} -f ${WRAPPER_BINDIR}/${REGRESS}
47 .PHONY: regress do-regress
49 regress: wrapper do-regress
51 FAILED_TESTS= ${WRKDIR}/failed
52 PASSED_TESTS= ${WRKDIR}/passed
55 @if [ -f ${FAILED_TESTS} ]; then \
57 ${CAT} ${FAILED_TESTS} | while read test; do \
66 @if [ -f "${FAILED_TESTS}" ]; then \
67 ${ECHO} `${CAT} ${FAILED_TESTS} | ${WC} -l`; \
73 @if [ -f "${PASSED_TESTS}" ]; then \
74 ${ECHO} `${CAT} ${PASSED_TESTS} | ${WC} -l`; \
79 TEST_RESULT= runtest=`${SETENV} ${REGRESS_ENV} regress $$test`; \
80 ${ECHO} "(${.TARGET}) saw: $$test"; \
81 ${ECHO} "(${.TARGET}) got: $$runtest"; \
82 ${ECHO} "(${.TARGET}) expected: $$expected"; \
85 ${ECHO} "(${.TARGET}) result: PASS"; \
86 ${ECHO} "${.TARGET}" >> ${PASSED_TESTS}; \
89 ${ECHO} "(${.TARGET}) result: FAIL"; \
90 ${ECHO} "${.TARGET}" >> ${FAILED_TESTS}; \
94 TEST_DIR= ${.CURDIR}/tests
96 # If RUNTESTS is defined, then just run those tests, otherwise run them all.
98 TEST_MAKEFILES= ${RUNTESTS:S/^/${TEST_DIR}\//:S/$/.mk/}
99 . for _mkfile_ in ${TEST_MAKEFILES}
100 . if exists(${_mkfile_})
101 . include "${_mkfile_}"
105 . include "tests/include-pkgdir-slashdot.mk"
106 . include "tests/include-pkgdir.mk"
107 . include "tests/include-pkgsubdir.mk"
108 . include "tests/include-usr-include-slashdot.mk"
109 . include "tests/include-usr-include-subdir.mk"
110 . include "tests/include-usr-include.mk"
111 . include "tests/lib-expand.mk"
112 . include "tests/libdir-pkgdir-slashdot.mk"
113 . include "tests/libdir-pkgdir.mk"
114 . include "tests/libdir-pkgsubdir.mk"
115 . include "tests/libdir-usr-lib-slashdot.mk"
116 . include "tests/libdir-usr-lib-subdir.mk"
117 . include "tests/libdir-usr-lib.mk"
118 . include "tests/libpath.mk"
119 . include "tests/libpath-in-define.mk"
120 . include "tests/no-abspath.mk"
121 . include "tests/preserve-option.mk"
122 . include "tests/quoted-arg.mk"
123 . include "tests/remove-dir.mk"
124 . include "tests/remove-option.mk"
125 . include "tests/repeated-arg.mk"
126 . include "tests/rpath-merge.mk"
127 . include "tests/rpath-pkgdir-slashdot.mk"
128 . include "tests/rpath-pkgdir.mk"
129 . include "tests/rpath-pkgsubdir.mk"
130 . include "tests/rpath-split.mk"
131 . include "tests/rpath-usr-lib-slashdot.mk"
132 . include "tests/rpath-usr-lib-subdir.mk"
133 . include "tests/rpath-usr-lib.mk"
134 . include "tests/libpath-shlib.mk"
135 . include "tests/libpath-shmod.mk"
138 .include "../../mk/bsd.pkg.mk"