diff options
author | jlam <jlam@pkgsrc.org> | 2004-08-27 21:34:58 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-08-27 21:34:58 +0000 |
commit | 42dd56b818282263c6072db4a5689ea717a9826e (patch) | |
tree | cd7446ed70c1c18d3fd2b455d8d827d66690ae6e /regress/buildlink-transform | |
parent | d76ad0b5cde3b3383bd15b0d5f9096e658347715 (diff) | |
download | pkgsrc-42dd56b818282263c6072db4a5689ea717a9826e.tar.gz |
Add some regression tests for correctness of buildlink3 transformations.
Diffstat (limited to 'regress/buildlink-transform')
21 files changed, 222 insertions, 0 deletions
diff --git a/regress/buildlink-transform/Makefile b/regress/buildlink-transform/Makefile new file mode 100644 index 00000000000..3af2d438040 --- /dev/null +++ b/regress/buildlink-transform/Makefile @@ -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" diff --git a/regress/buildlink-transform/tests/include-pkgdir-slashdot.mk b/regress/buildlink-transform/tests/include-pkgdir-slashdot.mk new file mode 100644 index 00000000000..7870c5c7167 --- /dev/null +++ b/regress/buildlink-transform/tests/include-pkgdir-slashdot.mk @@ -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} diff --git a/regress/buildlink-transform/tests/include-pkgdir.mk b/regress/buildlink-transform/tests/include-pkgdir.mk new file mode 100644 index 00000000000..fa06c8861d1 --- /dev/null +++ b/regress/buildlink-transform/tests/include-pkgdir.mk @@ -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} diff --git a/regress/buildlink-transform/tests/include-pkgsubdir.mk b/regress/buildlink-transform/tests/include-pkgsubdir.mk new file mode 100644 index 00000000000..8dc9b3ae23b --- /dev/null +++ b/regress/buildlink-transform/tests/include-pkgsubdir.mk @@ -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} diff --git a/regress/buildlink-transform/tests/include-usr-include-slashdot.mk b/regress/buildlink-transform/tests/include-usr-include-slashdot.mk new file mode 100644 index 00000000000..fd9ca82857f --- /dev/null +++ b/regress/buildlink-transform/tests/include-usr-include-slashdot.mk @@ -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} diff --git a/regress/buildlink-transform/tests/include-usr-include-subdir.mk b/regress/buildlink-transform/tests/include-usr-include-subdir.mk new file mode 100644 index 00000000000..61dfbb39ff3 --- /dev/null +++ b/regress/buildlink-transform/tests/include-usr-include-subdir.mk @@ -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} diff --git a/regress/buildlink-transform/tests/include-usr-include.mk b/regress/buildlink-transform/tests/include-usr-include.mk new file mode 100644 index 00000000000..49a2a6fc3c2 --- /dev/null +++ b/regress/buildlink-transform/tests/include-usr-include.mk @@ -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} diff --git a/regress/buildlink-transform/tests/libdir-pkgdir-slashdot.mk b/regress/buildlink-transform/tests/libdir-pkgdir-slashdot.mk new file mode 100644 index 00000000000..87cd2382b08 --- /dev/null +++ b/regress/buildlink-transform/tests/libdir-pkgdir-slashdot.mk @@ -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} diff --git a/regress/buildlink-transform/tests/libdir-pkgdir.mk b/regress/buildlink-transform/tests/libdir-pkgdir.mk new file mode 100644 index 00000000000..9d3a7e6b27f --- /dev/null +++ b/regress/buildlink-transform/tests/libdir-pkgdir.mk @@ -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} diff --git a/regress/buildlink-transform/tests/libdir-pkgsubdir.mk b/regress/buildlink-transform/tests/libdir-pkgsubdir.mk new file mode 100644 index 00000000000..ab52bbc76e8 --- /dev/null +++ b/regress/buildlink-transform/tests/libdir-pkgsubdir.mk @@ -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} diff --git a/regress/buildlink-transform/tests/libdir-usr-lib-slashdot.mk b/regress/buildlink-transform/tests/libdir-usr-lib-slashdot.mk new file mode 100644 index 00000000000..450d55e2e63 --- /dev/null +++ b/regress/buildlink-transform/tests/libdir-usr-lib-slashdot.mk @@ -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} diff --git a/regress/buildlink-transform/tests/libdir-usr-lib-subdir.mk b/regress/buildlink-transform/tests/libdir-usr-lib-subdir.mk new file mode 100644 index 00000000000..3bca19556f1 --- /dev/null +++ b/regress/buildlink-transform/tests/libdir-usr-lib-subdir.mk @@ -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} diff --git a/regress/buildlink-transform/tests/libdir-usr-lib.mk b/regress/buildlink-transform/tests/libdir-usr-lib.mk new file mode 100644 index 00000000000..787c0b3086a --- /dev/null +++ b/regress/buildlink-transform/tests/libdir-usr-lib.mk @@ -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} diff --git a/regress/buildlink-transform/tests/no-abspath.mk b/regress/buildlink-transform/tests/no-abspath.mk new file mode 100644 index 00000000000..1ed9180e2ef --- /dev/null +++ b/regress/buildlink-transform/tests/no-abspath.mk @@ -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} diff --git a/regress/buildlink-transform/tests/repeated-arg.mk b/regress/buildlink-transform/tests/repeated-arg.mk new file mode 100644 index 00000000000..acb2d0ac20a --- /dev/null +++ b/regress/buildlink-transform/tests/repeated-arg.mk @@ -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} diff --git a/regress/buildlink-transform/tests/rpath-pkgdir-slashdot.mk b/regress/buildlink-transform/tests/rpath-pkgdir-slashdot.mk new file mode 100644 index 00000000000..3c722d8f352 --- /dev/null +++ b/regress/buildlink-transform/tests/rpath-pkgdir-slashdot.mk @@ -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} diff --git a/regress/buildlink-transform/tests/rpath-pkgdir.mk b/regress/buildlink-transform/tests/rpath-pkgdir.mk new file mode 100644 index 00000000000..a95affe1a09 --- /dev/null +++ b/regress/buildlink-transform/tests/rpath-pkgdir.mk @@ -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} diff --git a/regress/buildlink-transform/tests/rpath-pkgsubdir.mk b/regress/buildlink-transform/tests/rpath-pkgsubdir.mk new file mode 100644 index 00000000000..27816863e3f --- /dev/null +++ b/regress/buildlink-transform/tests/rpath-pkgsubdir.mk @@ -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} diff --git a/regress/buildlink-transform/tests/rpath-usr-lib-slashdot.mk b/regress/buildlink-transform/tests/rpath-usr-lib-slashdot.mk new file mode 100644 index 00000000000..57f5dc38620 --- /dev/null +++ b/regress/buildlink-transform/tests/rpath-usr-lib-slashdot.mk @@ -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} diff --git a/regress/buildlink-transform/tests/rpath-usr-lib-subdir.mk b/regress/buildlink-transform/tests/rpath-usr-lib-subdir.mk new file mode 100644 index 00000000000..6cdb4ac895d --- /dev/null +++ b/regress/buildlink-transform/tests/rpath-usr-lib-subdir.mk @@ -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} diff --git a/regress/buildlink-transform/tests/rpath-usr-lib.mk b/regress/buildlink-transform/tests/rpath-usr-lib.mk new file mode 100644 index 00000000000..804fc2b1213 --- /dev/null +++ b/regress/buildlink-transform/tests/rpath-usr-lib.mk @@ -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} |