From d7700ff7fde6e68207ee20008430ee59ba5759e8 Mon Sep 17 00:00:00 2001 From: Gleb Popov Date: Sat, 17 Feb 2024 19:15:04 +0300 Subject: Framework: Introduce testing feature Setting WITH_TESTING=yes will cause running `make test` between `stage` and `package` in the default pipeline. This feature is off by default. Sponsored by: Serenity Cybersecurity, LLC --- Mk/Features/testing.mk | 15 +++++++++++++++ Mk/bsd.port.mk | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 Mk/Features/testing.mk diff --git a/Mk/Features/testing.mk b/Mk/Features/testing.mk new file mode 100644 index 000000000000..15af7e28eb7c --- /dev/null +++ b/Mk/Features/testing.mk @@ -0,0 +1,15 @@ +# Automatic testing Support +# +# Add WITH_TESTING=yes into make.conf: +# - If set, and the port supports it, the software's test suite will be compiled +# and run during the normal building pipeline between 'stage' and 'package' +# stages. + +.if !defined(_TESTING_MK_INCLUDED) +_TESTING_MK_INCLUDED= yes +TESTING_Include_MAINTAINER= portmgr@FreeBSD.org + +_TESTING_PACKAGE_DEP= test + +.endif + diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 5258bcfeb55b..32baeb54b242 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1013,7 +1013,7 @@ LC_ALL= C # These need to be absolute since we don't know how deep in the ports # tree we are and thus can't go relative. They can, of course, be overridden # by individual Makefiles or local system make configuration. -_LIST_OF_WITH_FEATURES= bind_now debug debuginfo lto pie relro sanitize ssp +_LIST_OF_WITH_FEATURES= bind_now debug debuginfo lto pie relro sanitize ssp testing _DEFAULT_WITH_FEATURES= ssp PORTSDIR?= /usr/ports LOCALBASE?= /usr/local @@ -5490,7 +5490,7 @@ _INSTALL_SEQ= 100:install-message \ 300:create-manifest _INSTALL_SUSEQ= 400:fake-pkg 500:security-check -_PACKAGE_DEP= stage +_PACKAGE_DEP= stage ${_TESTING_PACKAGE_DEP} _PACKAGE_SEQ= 100:package-message 300:pre-package 450:pre-package-script \ 500:do-package 850:post-package-script \ ${_OPTIONS_package} ${_USES_package} -- cgit v1.2.3