Add some regression tests for correctness of buildlink3 transformations.

This commit is contained in:
jlam 2004-08-27 21:34:58 +00:00
parent d76ad0b5cd
commit 42dd56b818
21 changed files with 222 additions and 0 deletions

View file

@ -0,0 +1,62 @@
# $NetBSD: Makefile,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
DISTNAME= regress-buildlink-transform-0.0
CATEGORIES= regress
MASTER_SITES= # empty
DISTFILES= # empty
MAINTAINER= jlam@NetBSD.org
COMMENT= test buildlink wrapper transformation
.include "../../mk/bsd.prefs.mk"
USE_BUILDLINK3= yes
NO_CONFIGURE= yes
NO_BUILD= yes
NO_INSTALL= yes
NO_PACKAGE= yes
REGRESS_ENV= PATH=${PATH}
REGRESS_ENV+= WRAPPER_DEBUG=yes
REGRESS= ${ECHO}
_WRAPPEES+= REGRESS
_WRAP_ALIASES.REGRESS= regress
post-wrapper:
@${RM} ${WRAPPER_BINDIR}/${REGRESS}
.PHONY: regress do-regress
regress: wrapper
@cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} do-regress PKG_PHASE=wrapper
do-regress:
@${DO_NADA}
TEST_RESULT= runtest=`${SETENV} ${REGRESS_ENV} regress $$test`; \
${ECHO} "(${.TARGET}) saw: $$test"; \
${ECHO} "(${.TARGET}) got: $$runtest"; \
${ECHO} "(${.TARGET}) expected: $$expected"; \
case $$runtest in \
$$expected) ;; \
*) exit 1 ;; \
esac
TEST_DIR= ${.CURDIR}/tests
# If RUNTESTS is defined, then just run those tests, otherwise run them all.
.if defined(RUNTESTS)
TEST_MAKEFILES= ${RUNTESTS:S/^/${TEST_DIR}\//:S/$/.mk/}
.else
TEST_MAKEFILES!= \
${FIND} ${TEST_DIR} -name "*.mk" -print || ${ECHO} "none"
.endif
.for _mkfile_ in ${TEST_MAKEFILES}
. if exists(${_mkfile_})
. include "${_mkfile_}"
. endif
.endfor
.include "../../mk/bsd.pkg.mk"

View file

@ -0,0 +1,8 @@
# $NetBSD: include-pkgdir-slashdot.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: include-pkgdir-slashdot
do-regress: include-pkgdir-slashdot
include-pkgdir-slashdot:
@test="-I${LOCALBASE}/include/."; \
expected="-I${BUILDLINK_DIR}/include"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: include-pkgdir.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: include-pkgdir
do-regress: include-pkgdir
include-pkgdir:
@test="-I${LOCALBASE}/include"; \
expected="-I${BUILDLINK_DIR}/include"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: include-pkgsubdir.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: include-pkgsubdir
do-regress: include-pkgsubdir
include-pkgsubdir:
@test="-I${LOCALBASE}/include/krb5"; \
expected="-I${BUILDLINK_DIR}/include/krb5"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: include-usr-include-slashdot.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: include-usr-include-slashdot
do-regress: include-usr-include-slashdot
include-usr-include-slashdot:
@test="-I/usr/include/."; \
expected=""; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: include-usr-include-subdir.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: include-usr-include-subdir
do-regress: include-usr-include-subdir
include-usr-include-subdir:
@test="-I/usr/include/krb5"; \
expected="-I/usr/include/krb5"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: include-usr-include.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: include-usr-include
do-regress: include-usr-include
include-usr-include:
@test="-I/usr/include"; \
expected=""; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: libdir-pkgdir-slashdot.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: libdir-pkgdir-slashdot
do-regress: libdir-pkgdir-slashdot
libdir-pkgdir-slashdot:
@test="-L${LOCALBASE}/lib/."; \
expected="-L${BUILDLINK_DIR}/lib"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: libdir-pkgdir.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: libdir-pkgdir
do-regress: libdir-pkgdir
libdir-pkgdir:
@test="-L${LOCALBASE}/lib"; \
expected="-L${BUILDLINK_DIR}/lib"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: libdir-pkgsubdir.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: libdir-pkgsubdir
do-regress: libdir-pkgsubdir
libdir-pkgsubdir:
@test="-L${LOCALBASE}/lib/mysql"; \
expected="-L${BUILDLINK_DIR}/lib/mysql"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: libdir-usr-lib-slashdot.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: libdir-usr-lib-slashdot
do-regress: libdir-usr-lib-slashdot
libdir-usr-lib-slashdot:
@test="-L/usr/lib/."; \
expected=""; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: libdir-usr-lib-subdir.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: libdir-usr-lib-subdir
do-regress: libdir-usr-lib-subdir
libdir-usr-lib-subdir:
@test="-L/usr/lib/i18n"; \
expected="-L/usr/lib/i18n"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: libdir-usr-lib.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: libdir-usr-lib
do-regress: libdir-usr-lib
libdir-usr-lib:
@test="-L/usr/lib"; \
expected=""; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: no-abspath.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: no-abspath
do-regress: no-abspath
no-abspath:
@test="-L/bad/path/lib -I/bad/path/include ${COMPILER_RPATH_FLAG}/bad/path/lib"; \
expected=""; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: repeated-arg.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: repeated-arg
do-regress: repeated-arg
repeated-arg:
@test="-L${LOCALBASE}/lib -L${LOCALBASE}/lib"; \
expected="-L${BUILDLINK_DIR}/lib"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: rpath-pkgdir-slashdot.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: rpath-pkgdir-slashdot
do-regress: rpath-pkgdir-slashdot
rpath-pkgdir-slashdot:
@test="${COMPILER_RPATH_FLAG}${LOCALBASE}/lib/."; \
expected="${COMPILER_RPATH_FLAG}${LOCALBASE}/lib"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: rpath-pkgdir.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: rpath-pkgdir
do-regress: rpath-pkgdir
rpath-pkgdir:
@test="${COMPILER_RPATH_FLAG}${LOCALBASE}/lib"; \
expected="${COMPILER_RPATH_FLAG}${LOCALBASE}/lib"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: rpath-pkgsubdir.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: rpath-pkgsubdir
do-regress: rpath-pkgsubdir
rpath-pkgsubdir:
@test="${COMPILER_RPATH_FLAG}${LOCALBASE}/lib/mysql"; \
expected="${COMPILER_RPATH_FLAG}${LOCALBASE}/lib/mysql"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: rpath-usr-lib-slashdot.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: rpath-usr-lib-slashdot
do-regress: rpath-usr-lib-slashdot
rpath-usr-lib-slashdot:
@test="${COMPILER_RPATH_FLAG}/usr/lib/."; \
expected=""; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: rpath-usr-lib-subdir.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: rpath-usr-lib-subdir
do-regress: rpath-usr-lib-subdir
rpath-usr-lib-subdir:
@test="${COMPILER_RPATH_FLAG}/usr/lib/i18n"; \
expected="${COMPILER_RPATH_FLAG}/usr/lib/i18n"; \
${TEST_RESULT}

View file

@ -0,0 +1,8 @@
# $NetBSD: rpath-usr-lib.mk,v 1.1.1.1 2004/08/27 21:34:58 jlam Exp $
.PHONY: rpath-usr-lib
do-regress: rpath-usr-lib
rpath-usr-lib:
@test="${COMPILER_RPATH_FLAG}/usr/lib"; \
expected=""; \
${TEST_RESULT}