git: b6d3556bbb4b - main - audio/flac: skip tests when building as root

From: Christian Weisgerber <naddy_at_FreeBSD.org>
Date: Mon, 10 Oct 2022 13:44:46 UTC
The branch main has been updated by naddy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b6d3556bbb4b062ea3f922f13c04e93cce2a5f0a

commit b6d3556bbb4b062ea3f922f13c04e93cce2a5f0a
Author:     Christian Weisgerber <naddy@FreeBSD.org>
AuthorDate: 2022-10-10 13:33:21 +0000
Commit:     Christian Weisgerber <naddy@FreeBSD.org>
CommitDate: 2022-10-10 13:44:43 +0000

    audio/flac: skip tests when building as root
    
    A few tests in the included test suite can intentionally not be run
    as root, e.g. test_libFLAC:
    "iterator claims file is writable when tester thinks it should not be"
    
    Skip the tests when building as root and provide a brief message.
    
    PR:             266575
    Reported by:    diizzy
---
 audio/flac/Makefile | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/audio/flac/Makefile b/audio/flac/Makefile
index 29c6f0fe134a..7dddce282528 100644
--- a/audio/flac/Makefile
+++ b/audio/flac/Makefile
@@ -37,7 +37,7 @@ TEST_TARGET=	check
 
 OPTIONS_DEFINE=	DOCS
 
-.include <bsd.port.options.mk>
+.include <bsd.port.pre.mk>
 
 .if ${ARCH} == "i386"
 BUILD_DEPENDS+=	nasm:devel/nasm
@@ -47,4 +47,11 @@ BUILD_DEPENDS+=	nasm:devel/nasm
 CONFIGURE_ARGS+=--disable-vsx
 .endif
 
-.include <bsd.port.mk>
+# test_libFLAC:
+# "iterator claims file is writable when tester thinks it should not be"
+.if ${UID} == 0
+do-test:
+	@${ECHO_MSG} "The tests cannot be run as root, skipping."
+.endif
+
+.include <bsd.port.post.mk>