PORTNAME=	testthat
DISTVERSION=	3.3.2
CATEGORIES=	devel
DISTNAME=	${PORTNAME}_${DISTVERSION}

MAINTAINER=	eduardo@FreeBSD.org
COMMENT=	Unit Testing for R
WWW=		https://testthat.r-lib.org

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

BUILD_DEPENDS=	R-cran-knitr>0:print/R-cran-knitr
RUN_DEPENDS=	R-cran-brio>=1.1.5:devel/R-cran-brio \
		R-cran-callr>=3.7.6:devel/R-cran-callr \
		R-cran-cli>=3.6.5:devel/R-cran-cli \
		R-cran-desc>=1.4.3:devel/R-cran-desc \
		R-cran-digest>=0.6.33:security/R-cran-digest \
		R-cran-evaluate>=1.0.4:devel/R-cran-evaluate \
		R-cran-jsonlite>=2.0.0:converters/R-cran-jsonlite \
		R-cran-lifecycle>=1.0.4:devel/R-cran-lifecycle \
		R-cran-magrittr>=2.0.3:devel/R-cran-magrittr \
		R-cran-pkgload>=1.4.0:devel/R-cran-pkgload \
		R-cran-praise>=1.0.0:devel/R-cran-praise \
		R-cran-processx>=3.8.6:sysutils/R-cran-processx \
		R-cran-ps>=1.9.1:sysutils/R-cran-ps \
		R-cran-R6>=2.6.1:devel/R-cran-R6 \
		R-cran-rlang>=1.1.6:devel/R-cran-rlang \
		R-cran-waldo>=0.6.2:devel/R-cran-waldo \
		R-cran-withr>=3.0.2:devel/R-cran-withr

USES=		cran:auto-plist,compiles

MAKE_ENV=	LC_ALL=C.UTF-8

do-test:
	@${FIND} ${WRKSRC} \( -name '*.o' -o -name '*.so' \) -delete
	@cd ${WRKDIR} ; ${SETENV} ${MAKE_ENV} _R_CHECK_FORCE_SUGGESTS_=FALSE \
	${LOCALBASE}/bin/R CMD check --no-manual ${PORTNAME}

.include <bsd.port.mk>
