[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / regress / buildlink-transform

File: [cvs.NetBSD.org] / pkgsrc / regress / buildlink-transform / Makefile (download)

Revision 1.18, Mon Jul 10 22:59:27 2006 UTC (17 years, 9 months ago) by jlam
Branch: MAIN
CVS Tags: pkgsrc-2009Q1-base, pkgsrc-2009Q1, pkgsrc-2008Q4-base, pkgsrc-2008Q4, pkgsrc-2008Q3-base, pkgsrc-2008Q3, pkgsrc-2008Q2-base, pkgsrc-2008Q2, pkgsrc-2008Q1-base, pkgsrc-2008Q1, pkgsrc-2007Q4-base, pkgsrc-2007Q4, pkgsrc-2007Q3-base, pkgsrc-2007Q3, pkgsrc-2007Q2-base, pkgsrc-2007Q2, pkgsrc-2007Q1-base, pkgsrc-2007Q1, pkgsrc-2006Q4-base, pkgsrc-2006Q4, pkgsrc-2006Q3-base, pkgsrc-2006Q3, cwrapper, cube-native-xorg-base, cube-native-xorg
Changes since 1.17: +1 -3 lines

Completely nuke the concept of PKG_PHASE from pkgsrc except for the
purposes of caching MAKEVARS within bsd.pkg.mk and bsd.makevars.mk.

# $NetBSD: Makefile,v 1.18 2006/07/10 22:59:27 jlam Exp $
#
# Run many buildlink transform tests in a single regression test to avoid
# having to keep creating the wrapper scripts over and over again.
#
DISTNAME=	regress-buildlink-transform-0.0
CATEGORIES=	regress
MASTER_SITES=	# empty
DISTFILES=	# empty

MAINTAINER=	jlam@pkgsrc.org
COMMENT=	test buildlink wrapper transformation

.include "../../mk/bsd.prefs.mk"

EXTRACT_ONLY=	# empty
NO_CONFIGURE=	yes
NO_INSTALL=	yes
NO_PACKAGE=	yes

# Remove GCC optimization options.
BUILDLINK_TRANSFORM+=	rm:-O[0-9]*

# Remove /opt/schily.
.if ${LOCALBASE} != "/opt/schily"
BUILDLINK_TRANSFORM+=	rmdir:/opt/schily
.endif

# Convert "-lreadline" into "-ledit -ltermcap -lm".
BUILDLINK_TRANSFORM+=	l:readline:edit:termcap:m

REGRESS_ENV=		PATH=${PATH}
REGRESS_ENV+=		WRAPPER_DEBUG=yes

# Create a "regress" script in the wrapper directory that just echoes its
# arguments.
#
REGRESS=		${ECHO}
WRAPPEES+=		REGRESS
_WRAP_ALIASES.REGRESS=	regress

post-wrapper:
	@${RM} -f ${WRAPPER_BINDIR}/${REGRESS}

.PHONY: regress do-regress

regress: wrapper do-regress

FAILED_TESTS=	${WRKDIR}/failed
PASSED_TESTS=	${WRKDIR}/passed

do-regress:
	@if [ -f ${FAILED_TESTS} ]; then				\
		${ECHO} "FAILED:";					\
		${CAT} ${FAILED_TESTS} | while read test; do		\
			${ECHO} "	$$test";			\
		done;							\
		exit 1;							\
	else								\
		${DO_NADA};						\
	fi

report-failed:
	@if [ -f "${FAILED_TESTS}" ]; then				\
		${ECHO} `${CAT} ${FAILED_TESTS} | ${WC} -l`;		\
	else								\
		${ECHO} "0";						\
	fi

report-passed:
	@if [ -f "${PASSED_TESTS}" ]; then				\
		${ECHO} `${CAT} ${PASSED_TESTS} | ${WC} -l`;		\
	else								\
		${ECHO} "0";						\
	fi

TEST_RESULT=	runtest=`${SETENV} ${REGRESS_ENV} regress $$test`;	\
		${ECHO} "(${.TARGET}) saw:      $$test";		\
		${ECHO} "(${.TARGET}) got:      $$runtest";		\
		${ECHO} "(${.TARGET}) expected: $$expected";		\
		case $$runtest in					\
		$$expected)						\
			${ECHO} "(${.TARGET}) result:   PASS";		\
			${ECHO} "${.TARGET}" >> ${PASSED_TESTS};	\
			;;						\
		*)							\
			${ECHO} "(${.TARGET}) result:   FAIL";		\
			${ECHO} "${.TARGET}" >> ${FAILED_TESTS};	\
			;;						\
		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/}
.  for _mkfile_ in ${TEST_MAKEFILES}
.    if exists(${_mkfile_})
.      include "${_mkfile_}"
.    endif
.  endfor
.else
.  include "tests/include-pkgdir-slashdot.mk"
.  include "tests/include-pkgdir.mk"
.  include "tests/include-pkgsubdir.mk"
.  include "tests/include-usr-include-slashdot.mk"
.  include "tests/include-usr-include-subdir.mk"
.  include "tests/include-usr-include.mk"
.  include "tests/lib-expand.mk"
.  include "tests/libdir-pkgdir-slashdot.mk"
.  include "tests/libdir-pkgdir.mk"
.  include "tests/libdir-pkgsubdir.mk"
.  include "tests/libdir-usr-lib-slashdot.mk"
.  include "tests/libdir-usr-lib-subdir.mk"
.  include "tests/libdir-usr-lib.mk"
.  include "tests/libpath.mk"
.  include "tests/libpath-in-define.mk"
.  include "tests/no-abspath.mk"
.  include "tests/preserve-option.mk"
.  include "tests/quoted-arg.mk"
.  include "tests/remove-dir.mk"
.  include "tests/remove-option.mk"
.  include "tests/repeated-arg.mk"
.  include "tests/rpath-merge.mk"
.  include "tests/rpath-pkgdir-slashdot.mk"
.  include "tests/rpath-pkgdir.mk"
.  include "tests/rpath-pkgsubdir.mk"
.  include "tests/rpath-split.mk"
.  include "tests/rpath-usr-lib-slashdot.mk"
.  include "tests/rpath-usr-lib-subdir.mk"
.  include "tests/rpath-usr-lib.mk"
.  include "tests/libpath-shlib.mk"
.  include "tests/libpath-shmod.mk"
.endif

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