summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <arrowd@FreeBSD.org>2024-02-17 19:15:04 +0300
committerGleb Popov <arrowd@FreeBSD.org>2024-02-29 09:07:11 +0300
commitd7700ff7fde6e68207ee20008430ee59ba5759e8 (patch)
treee5063ae4ff9a06a68bda15e6587e1ee9ca25013e
parent7127338d6a2b8af61ff94c03657169463ac968aa (diff)
downloadfreebsd-ports-d7700ff7fde6e68207ee20008430ee59ba5759e8.zip
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
-rw-r--r--Mk/Features/testing.mk15
-rw-r--r--Mk/bsd.port.mk4
2 files changed, 17 insertions, 2 deletions
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}